From 65cb6e909286e98a44e3544a698556ca77bc1aa2 Mon Sep 17 00:00:00 2001 From: Konstantin Zolotarev Date: Wed, 23 Jan 2019 19:44:09 +0100 Subject: [PATCH] VDB-205 Fix external configuration values (#121) * Updated loading config from /Users/konstantinzolotarev/.vulcanizedb for addreses * Updated contract addresses loading from env variables. * Implement getter chain for addresses, configs and transformers Solves the issue with declaring stuff as vars when the environment file hasn't been loaded yet. Instead, this data is fetched dynamically when the root commands are called. * Update test data to use constant Kovan addresses * Decouple integration tests from config file IO * Add ABI to environment file, convert getter chains for related values * Decouple tests suites from ABI config file IO * Add startingBlock to environment and implement getter chain * Exit when called without config file * Add missing deployment blocks to staging.toml * Remove comment --- cmd/continuousLogSync.go | 56 ++-- cmd/getSignatures.go | 60 ++--- cmd/root.go | 23 +- environments/staging.toml | 60 +++-- pkg/transformers/bite/config.go | 16 +- pkg/transformers/bite/converter_test.go | 3 +- pkg/transformers/cat_file/chop_lump/config.go | 16 +- pkg/transformers/cat_file/flip/config.go | 16 +- pkg/transformers/cat_file/pit_vow/config.go | 16 +- pkg/transformers/deal/config.go | 17 +- pkg/transformers/dent/config.go | 16 +- pkg/transformers/drip_drip/config.go | 15 +- pkg/transformers/drip_file/ilk/config.go | 16 +- pkg/transformers/drip_file/repo/config.go | 16 +- pkg/transformers/drip_file/vow/config.go | 16 +- pkg/transformers/flap_kick/config.go | 16 +- pkg/transformers/flap_kick/converter_test.go | 3 +- pkg/transformers/flip_kick/config.go | 16 +- pkg/transformers/flip_kick/converter_test.go | 3 +- pkg/transformers/flop_kick/config.go | 16 +- pkg/transformers/flop_kick/converter_test.go | 3 +- pkg/transformers/frob/config.go | 16 +- pkg/transformers/frob/converter_test.go | 3 +- pkg/transformers/integration_tests/bite.go | 15 +- .../integration_tests/cat_file.go | 35 ++- pkg/transformers/integration_tests/deal.go | 16 +- pkg/transformers/integration_tests/dent.go | 11 +- .../integration_tests/drip_drip.go | 12 +- .../integration_tests/drip_file_vow.go | 13 +- .../integration_tests/flap_kick.go | 13 +- .../integration_tests/flip_kick.go | 15 +- .../integration_tests/flop_kick.go | 13 +- pkg/transformers/integration_tests/frob.go | 14 +- .../pit_file_debt_ceiling.go | 13 +- .../integration_tests/pit_file_ilk.go | 11 +- .../integration_tests/price_feeds.go | 23 +- pkg/transformers/integration_tests/tend.go | 10 +- .../integration_tests/vat_flux.go | 13 +- .../integration_tests/vat_fold.go | 13 +- .../integration_tests/vat_grab.go | 13 +- .../integration_tests/vat_heal.go | 13 +- .../integration_tests/vat_init.go | 13 +- .../integration_tests/vat_move.go | 13 +- .../integration_tests/vat_slip.go | 13 +- .../integration_tests/vat_tune.go | 13 +- .../integration_tests/vow_flog.go | 13 +- .../pit_file/debt_ceiling/config.go | 16 +- pkg/transformers/pit_file/ilk/config.go | 16 +- pkg/transformers/price_feeds/config.go | 24 +- pkg/transformers/shared/constants/abi.go | 14 - pkg/transformers/shared/constants/address.go | 26 -- .../event_signature_generator_test.go | 47 ++-- pkg/transformers/shared/constants/external.go | 78 ++++++ pkg/transformers/shared/constants/label.go | 2 +- pkg/transformers/shared/constants/method.go | 60 +++-- .../shared/constants/signature.go | 58 ++--- pkg/transformers/shared/utilities.go | 13 + pkg/transformers/tend/config.go | 16 +- pkg/transformers/test_data/abi.go | 14 + pkg/transformers/test_data/addresses.go | 15 ++ pkg/transformers/test_data/bite.go | 5 +- pkg/transformers/test_data/cat_file.go | 9 +- pkg/transformers/test_data/deal.go | 5 +- pkg/transformers/test_data/dent.go | 3 +- pkg/transformers/test_data/drip_drip.go | 3 +- pkg/transformers/test_data/drip_file.go | 7 +- pkg/transformers/test_data/flap_kick.go | 3 +- pkg/transformers/test_data/flip_kick.go | 5 +- pkg/transformers/test_data/flop_kick.go | 3 +- pkg/transformers/test_data/frob.go | 3 +- pkg/transformers/test_data/pit_file.go | 7 +- pkg/transformers/test_data/price_feed.go | 3 +- pkg/transformers/test_data/signatures.go | 32 +++ pkg/transformers/test_data/tend.go | 3 +- pkg/transformers/test_data/vat_flux.go | 3 +- pkg/transformers/test_data/vat_fold.go | 3 +- pkg/transformers/test_data/vat_grab.go | 3 +- pkg/transformers/test_data/vat_heal.go | 3 +- pkg/transformers/test_data/vat_init.go | 3 +- pkg/transformers/test_data/vat_move.go | 3 +- pkg/transformers/test_data/vat_slip.go | 3 +- pkg/transformers/test_data/vat_toll.go | 3 +- pkg/transformers/test_data/vat_tune.go | 3 +- pkg/transformers/test_data/vow_flog.go | 3 +- pkg/transformers/transformers.go | 240 +++++++++++------- pkg/transformers/vat_flux/config.go | 16 +- pkg/transformers/vat_fold/config.go | 16 +- pkg/transformers/vat_fold/converter.go | 7 - pkg/transformers/vat_grab/config.go | 16 +- pkg/transformers/vat_heal/config.go | 16 +- pkg/transformers/vat_init/config.go | 16 +- pkg/transformers/vat_move/config.go | 16 +- pkg/transformers/vat_slip/config.go | 16 +- pkg/transformers/vat_toll/config.go | 16 +- pkg/transformers/vat_tune/config.go | 16 +- pkg/transformers/vow_flog/config.go | 16 +- test_config/test_config.go | 6 +- 97 files changed, 1051 insertions(+), 651 deletions(-) delete mode 100644 pkg/transformers/shared/constants/abi.go delete mode 100644 pkg/transformers/shared/constants/address.go create mode 100644 pkg/transformers/shared/constants/external.go create mode 100644 pkg/transformers/test_data/abi.go create mode 100644 pkg/transformers/test_data/addresses.go create mode 100644 pkg/transformers/test_data/signatures.go diff --git a/cmd/continuousLogSync.go b/cmd/continuousLogSync.go index 710a6bf4..19ab7319 100644 --- a/cmd/continuousLogSync.go +++ b/cmd/continuousLogSync.go @@ -88,34 +88,34 @@ func getTransformerInitializers(transformerNames []string) []shared2.Transformer func buildTransformerInitializerMap() map[string]shared2.TransformerInitializer { initializerMap := make(map[string]shared2.TransformerInitializer) - initializerMap[constants.BiteLabel] = transformers.BiteTransformer.NewTransformer - initializerMap[constants.CatFileChopLumpLabel] = transformers.CatFileChopLumpTransformer.NewLogNoteTransformer - initializerMap[constants.CatFileFlipLabel] = transformers.CatFileFlipTransformer.NewLogNoteTransformer - initializerMap[constants.CatFilePitVowLabel] = transformers.CatFilePitVowTransformer.NewLogNoteTransformer - initializerMap[constants.DealLabel] = transformers.DealTransformer.NewLogNoteTransformer - initializerMap[constants.DentLabel] = transformers.DentTransformer.NewLogNoteTransformer - initializerMap[constants.DripDripLabel] = transformers.DripDripTransformer.NewLogNoteTransformer - initializerMap[constants.DripFileIlkLabel] = transformers.DripFileIlkTransformer.NewLogNoteTransformer - initializerMap[constants.DripFileRepoLabel] = transformers.DripFileRepoTransformer.NewLogNoteTransformer - initializerMap[constants.DripFileVowLabel] = transformers.DripFileVowTransfromer.NewLogNoteTransformer - initializerMap[constants.FlapKickLabel] = transformers.FlapKickTransformer.NewTransformer - initializerMap[constants.FlipKickLabel] = transformers.FlipKickTransformer.NewTransformer - initializerMap[constants.FlopKickLabel] = transformers.FlopKickTransformer.NewTransformer - initializerMap[constants.FrobLabel] = transformers.FrobTransformer.NewTransformer - initializerMap[constants.PitFileDebtCeilingLabel] = transformers.PitFileDebtCeilingTransformer.NewLogNoteTransformer - initializerMap[constants.PitFileIlkLabel] = transformers.PitFileIlkTransformer.NewLogNoteTransformer - initializerMap[constants.PriceFeedLabel] = transformers.PriceFeedTransformer.NewLogNoteTransformer - initializerMap[constants.TendLabel] = transformers.TendTransformer.NewLogNoteTransformer - initializerMap[constants.VatFluxLabel] = transformers.VatFluxTransformer.NewLogNoteTransformer - initializerMap[constants.VatFoldLabel] = transformers.VatFoldTransformer.NewLogNoteTransformer - initializerMap[constants.VatGrabLabel] = transformers.VatGrabTransformer.NewLogNoteTransformer - initializerMap[constants.VatHealLabel] = transformers.VatHealTransformer.NewLogNoteTransformer - initializerMap[constants.VatInitLabel] = transformers.VatInitTransformer.NewLogNoteTransformer - initializerMap[constants.VatMoveLabel] = transformers.VatMoveTransformer.NewLogNoteTransformer - initializerMap[constants.VatSlipLabel] = transformers.VatSlipTransformer.NewLogNoteTransformer - initializerMap[constants.VatTollLabel] = transformers.VatTollTransformer.NewLogNoteTransformer - initializerMap[constants.VatTuneLabel] = transformers.VatTuneTransformer.NewLogNoteTransformer - initializerMap[constants.VowFlogLabel] = transformers.FlogTransformer.NewLogNoteTransformer + initializerMap[constants.BiteLabel] = transformers.GetBiteTransformer().NewTransformer + initializerMap[constants.CatFileChopLumpLabel] = transformers.GetCatFileChopLumpTransformer().NewLogNoteTransformer + initializerMap[constants.CatFileFlipLabel] = transformers.GetCatFileFlipTransformer().NewLogNoteTransformer + initializerMap[constants.CatFilePitVowLabel] = transformers.GetCatFilePitVowTransformer().NewLogNoteTransformer + initializerMap[constants.DealLabel] = transformers.GetDealTransformer().NewLogNoteTransformer + initializerMap[constants.DentLabel] = transformers.GetDentTransformer().NewLogNoteTransformer + initializerMap[constants.DripDripLabel] = transformers.GetDripDripTransformer().NewLogNoteTransformer + initializerMap[constants.DripFileIlkLabel] = transformers.GetDripFileIlkTransformer().NewLogNoteTransformer + initializerMap[constants.DripFileRepoLabel] = transformers.GetDripFileRepoTransformer().NewLogNoteTransformer + initializerMap[constants.DripFileVowLabel] = transformers.GetDripFileVowTransformer().NewLogNoteTransformer + initializerMap[constants.FlapKickLabel] = transformers.GetFlapKickTransformer().NewTransformer + initializerMap[constants.FlipKickLabel] = transformers.GetFlipKickTransformer().NewTransformer + initializerMap[constants.FlopKickLabel] = transformers.GetFlopKickTransformer().NewTransformer + initializerMap[constants.FrobLabel] = transformers.GetFrobTransformer().NewTransformer + initializerMap[constants.PitFileDebtCeilingLabel] = transformers.GetPitFileDebtCeilingTransformer().NewLogNoteTransformer + initializerMap[constants.PitFileIlkLabel] = transformers.GetPitFileIlkTransformer().NewLogNoteTransformer + initializerMap[constants.PriceFeedLabel] = transformers.GetPriceFeedTransformer().NewLogNoteTransformer + initializerMap[constants.TendLabel] = transformers.GetTendTransformer().NewLogNoteTransformer + initializerMap[constants.VatFluxLabel] = transformers.GetVatFluxTransformer().NewLogNoteTransformer + initializerMap[constants.VatFoldLabel] = transformers.GetVatFoldTransformer().NewLogNoteTransformer + initializerMap[constants.VatGrabLabel] = transformers.GetVatGrabTransformer().NewLogNoteTransformer + initializerMap[constants.VatHealLabel] = transformers.GetVatHealTransformer().NewLogNoteTransformer + initializerMap[constants.VatInitLabel] = transformers.GetVatInitTransformer().NewLogNoteTransformer + initializerMap[constants.VatMoveLabel] = transformers.GetVatMoveTransformer().NewLogNoteTransformer + initializerMap[constants.VatSlipLabel] = transformers.GetVatSlipTransformer().NewLogNoteTransformer + initializerMap[constants.VatTollLabel] = transformers.GetVatTollTransformer().NewLogNoteTransformer + initializerMap[constants.VatTuneLabel] = transformers.GetVatTuneTransformer().NewLogNoteTransformer + initializerMap[constants.VowFlogLabel] = transformers.GetFlogTransformer().NewLogNoteTransformer return initializerMap } diff --git a/cmd/getSignatures.go b/cmd/getSignatures.go index 872d3fd5..c5a098ff 100644 --- a/cmd/getSignatures.go +++ b/cmd/getSignatures.go @@ -15,7 +15,7 @@ package cmd import ( - log "github.com/sirupsen/logrus" + "fmt" "github.com/spf13/cobra" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) @@ -33,37 +33,37 @@ vulcanizedb getSignatures`, func getSignatures() { signatures := make(map[string]string) - signatures["BiteSignature"] = constants.BiteSignature - signatures["CatFileChopLumpSignature"] = constants.CatFileChopLumpSignature - signatures["CatFileFlipSignature"] = constants.CatFileFlipSignature - signatures["CatFilePitVowSignature"] = constants.CatFilePitVowSignature - signatures["DealSignature"] = constants.DealSignature - signatures["DentFunctionSignature"] = constants.DentFunctionSignature - signatures["DripDripSignature"] = constants.DripDripSignature - signatures["DripFileIlkSignature"] = constants.DripFileIlkSignature - signatures["DripFileRepoSignature"] = constants.DripFileRepoSignature - signatures["DripFileVowSignature"] = constants.DripFileVowSignature - signatures["FlapKickSignature"] = constants.FlapKickSignature - signatures["FlipKickSignature"] = constants.FlipKickSignature - signatures["FlopKickSignature"] = constants.FlopKickSignature - signatures["FrobSignature"] = constants.FrobSignature - signatures["LogValueSignature"] = constants.LogValueSignature - signatures["PitFileDebtCeilingSignature"] = constants.PitFileDebtCeilingSignature - signatures["PitFileIlkSignature"] = constants.PitFileIlkSignature - signatures["TendFunctionSignature"] = constants.TendFunctionSignature - signatures["VatFluxSignature"] = constants.VatFluxSignature - signatures["VatFoldSignature"] = constants.VatFoldSignature - signatures["VatGrabSignature"] = constants.VatGrabSignature - signatures["VatHealSignature"] = constants.VatHealSignature - signatures["VatInitSignature"] = constants.VatInitSignature - signatures["VatMoveSignature"] = constants.VatMoveSignature - signatures["VatSlipSignature"] = constants.VatSlipSignature - signatures["VatTollSignature"] = constants.VatTollSignature - signatures["VatTuneSignature"] = constants.VatTuneSignature - signatures["VowFlogSignature"] = constants.VowFlogSignature + signatures["BiteSignature"] = constants.GetBiteSignature() + signatures["CatFileChopLumpSignature"] = constants.GetCatFileChopLumpSignature() + signatures["CatFileFlipSignature"] = constants.GetCatFileFlipSignature() + signatures["CatFilePitVowSignature"] = constants.GetCatFilePitVowSignature() + signatures["DealSignature"] = constants.GetDealSignature() + signatures["DentFunctionSignature"] = constants.GetDentFunctionSignature() + signatures["DripDripSignature"] = constants.GetDripDripSignature() + signatures["DripFileIlkSignature"] = constants.GetDripFileIlkSignature() + signatures["DripFileRepoSignature"] = constants.GetDripFileRepoSignature() + signatures["DripFileVowSignature"] = constants.GetDripFileVowSignature() + signatures["FlapKickSignature"] = constants.GetFlapKickSignature() + signatures["FlipKickSignature"] = constants.GetFlipKickSignature() + signatures["FlopKickSignature"] = constants.GetFlopKickSignature() + signatures["FrobSignature"] = constants.GetFrobSignature() + signatures["LogValueSignature"] = constants.GetLogValueSignature() + signatures["PitFileDebtCeilingSignature"] = constants.GetPitFileDebtCeilingSignature() + signatures["PitFileIlkSignature"] = constants.GetPitFileIlkSignature() + signatures["TendFunctionSignature"] = constants.GetTendFunctionSignature() + signatures["VatFluxSignature"] = constants.GetVatFluxSignature() + signatures["VatFoldSignature"] = constants.GetVatFoldSignature() + signatures["VatGrabSignature"] = constants.GetVatGrabSignature() + signatures["VatHealSignature"] = constants.GetVatHealSignature() + signatures["VatInitSignature"] = constants.GetVatInitSignature() + signatures["VatMoveSignature"] = constants.GetVatMoveSignature() + signatures["VatSlipSignature"] = constants.GetVatSlipSignature() + signatures["VatTollSignature"] = constants.GetVatTollSignature() + signatures["VatTuneSignature"] = constants.GetVatTuneSignature() + signatures["VowFlogSignature"] = constants.GetVowFlogSignature() for name, sig := range signatures { - log.Println(name, ": ", sig) + fmt.Println(name, ": ", sig) } } diff --git a/cmd/root.go b/cmd/root.go index ad425540..ecf2d110 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,11 +15,11 @@ package cmd import ( + "fmt" "os" "time" "github.com/ethereum/go-ethereum/rpc" - "github.com/mitchellh/go-homedir" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -75,7 +75,7 @@ func database(cmd *cobra.Command, args []string) { func init() { cobra.OnInitialize(initConfig) - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "environment/public.toml", "config file location") + rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file location") rootCmd.PersistentFlags().String("database-name", "vulcanize_public", "database name") rootCmd.PersistentFlags().Int("database-port", 5432, "database port") rootCmd.PersistentFlags().String("database-hostname", "localhost", "database hostname") @@ -99,20 +99,19 @@ func initConfig() { if cfgFile != "" { viper.SetConfigFile(cfgFile) } else { - home, err := homedir.Dir() - if err != nil { - log.Fatal(err) - os.Exit(1) - } - - viper.AddConfigPath(home) - viper.SetConfigName(".vulcanizedb") + noConfigError := "No config file passed with --config flag" + fmt.Println("Error: ", noConfigError) + log.Fatal(noConfigError) + os.Exit(1) } - viper.AutomaticEnv() - if err := viper.ReadInConfig(); err == nil { log.Printf("Using config file: %s\n\n", viper.ConfigFileUsed()) + } else { + invalidConfigError := "Couldn't read config file" + fmt.Println("Error: ", invalidConfigError) + log.Fatal(invalidConfigError) + os.Exit(1) } } diff --git a/environments/staging.toml b/environments/staging.toml index bcdf0079..51569120 100644 --- a/environments/staging.toml +++ b/environments/staging.toml @@ -1,25 +1,49 @@ [database] -name = "vulcanize_public" -hostname = "localhost" -user = "vulcanize" -password = "vulcanize" -port = 5432 + name = "vulcanize_public" + hostname = "localhost" + user = "vulcanize" + password = "vulcanize" + port = 5432 [client] -ipcPath = "http://kovan0.vulcanize.io:8545" + ipcPath = "http://kovan0.vulcanize.io:8545" [datadog] -name = "maker_vdb_staging" + name = "maker_vdb_staging" [contract] -cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0" -drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d" -eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509" -mcd_flap = "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132" -mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa" -pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975" -pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc" -pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e" -rep = "0xf88bbdc1e2718f8857f30a180076ec38d53cf296" -vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b" -vow = "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1" + [contract.address] + cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0" + drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d" + eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509" + mcd_flap = "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132" + mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa" + pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975" + pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc" + pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e" + rep = "0xf88bbdc1e2718f8857f30a180076ec38d53cf296" + vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b" + vow = "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1" + [contract.abi] + cat = '[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x626cb3c5"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"flips","outputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"},{"name":"ink","type":"uint256"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x70d9235a"},{"constant":true,"inputs":[],"name":"nflip","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x76181a51"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"flip","type":"address"},{"name":"chop","type":"uint256"},{"name":"lump","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[],"name":"pit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf03c7c6e"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"tab","type":"uint256"},{"indexed":false,"name":"flip","type":"uint256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Bite","type":"event","signature":"0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xebecb39d"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"}],"name":"bite","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x72f7b593"},{"constant":false,"inputs":[{"name":"n","type":"uint256"},{"name":"wad","type":"uint256"}],"name":"flip","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6f95917"}]' + drip = '[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"repo","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x56ff3122"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"},{"name":"rho","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"drip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x44e2a5a8"}]' + mcd_flap = '[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"gal","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]' + eth_flip = '[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4423c5f1"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4e8b1dd5"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7bd2bea7"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7d780d82"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfc4af55"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfdd3302"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf4b9fa75"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"tab","type":"uint256"}],"name":"Kick","type":"event","signature":"0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xeae19d9e"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"tick","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xfc7b6aee"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x4b43ed12"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5ff3a382"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xc959c42b"}]' + mcd_flop = '[{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"vow","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]' + medianizer = '[{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"bytes32"}],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"compute","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"indexes","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"next","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"read","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"peek","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes12"}],"name":"values","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"min_","type":"uint96"}],"name":"setMin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"void","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"},{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"next_","type":"bytes12"}],"name":"setNext","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"min","outputs":[{"name":"","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"val","type":"bytes32"}],"name":"LogValue","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]]' + # TODO: replace with updated ABI when contract is deployed (with no pit file stability fee method + modified Frob event) + pit = '[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[],"name":"drip","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x9f678cca"},{"constant":true,"inputs":[],"name":"Line","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbabe8a3f"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"spot","type":"uint256"},{"name":"line","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"dink","type":"int256"},{"indexed":false,"name":"dart","type":"int256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Frob","type":"event","signature":"0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"frob","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5a984ded"}]' + vat = '[{"constant":true,"inputs":[],"name":"debt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x0dca59c1"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"urns","outputs":[{"name":"ink","type":"uint256"},{"name":"art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x26e27482"},{"constant":true,"inputs":[],"name":"vice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x2d61a355"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xa60f1d3e"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"gem","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc0912683"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"take","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"Ink","type":"uint256"},{"name":"Art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"dai","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf53e4e69"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":true,"name":"too","type":"bytes32"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"Note","type":"event","signature":"0x8c2dbbc2b33ffaa77c104b777e574a8a4ff79829dfee8b66f4dc63e3f8067152"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3b663195"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"guy","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"slip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x42066cbb"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"flux","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa6e41821"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x78f19470"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"tune","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5dd6471a"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"grab","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3690ae4c"},{"constant":false,"inputs":[{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x990a5f63"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"rate","type":"int256"}],"name":"fold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6a6a64d"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"take","type":"int256"}],"name":"toll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x09b7a0b5"}]' + vow = '[{"constant":true,"inputs":[],"name":"Awe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Joy","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"flap","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"hump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"kiss","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Ash","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"era","type":"uint48"}],"name":"flog","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Woe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wait","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"bump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tab","type":"uint256"}],"name":"fess","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"row","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint48"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"flop","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"addr","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]' + [contract.deployment-block] + cat = 8751794 + drip = 8762197 + eth_flip = 8535561 + mcd_flap = 8535544 + mcd_flop = 8535545 + pep = 8760655 + pip = 8760588 + pit = 8535538 + rep = 8760681 + vat = 8535536 + vow = 8751792 diff --git a/pkg/transformers/bite/config.go b/pkg/transformers/bite/config.go index 9fc37aa1..fa6cace7 100644 --- a/pkg/transformers/bite/config.go +++ b/pkg/transformers/bite/config.go @@ -21,11 +21,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var BiteConfig = shared.TransformerConfig{ - TransformerName: constants.BiteLabel, - ContractAddresses: []string{constants.CatContractAddress}, - ContractAbi: constants.CatABI, - Topic: constants.BiteSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetBiteConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.BiteLabel, + ContractAddresses: []string{constants.CatContractAddress()}, + ContractAbi: constants.CatABI(), + Topic: constants.GetBiteSignature(), + StartingBlockNumber: constants.CatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/bite/converter_test.go b/pkg/transformers/bite/converter_test.go index a62477d7..7a077ef4 100644 --- a/pkg/transformers/bite/converter_test.go +++ b/pkg/transformers/bite/converter_test.go @@ -24,7 +24,6 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/bite" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" ) @@ -33,7 +32,7 @@ var _ = Describe("Bite Converter", func() { Describe("ToEntity", func() { It("converts an eth log to a bite entity", func() { - entities, err := converter.ToEntities(constants.CatABI, []types.Log{test_data.EthBiteLog}) + entities, err := converter.ToEntities(test_data.KovanCatABI, []types.Log{test_data.EthBiteLog}) Expect(err).NotTo(HaveOccurred()) Expect(len(entities)).To(Equal(1)) diff --git a/pkg/transformers/cat_file/chop_lump/config.go b/pkg/transformers/cat_file/chop_lump/config.go index 32531ad9..cf2d33f4 100644 --- a/pkg/transformers/cat_file/chop_lump/config.go +++ b/pkg/transformers/cat_file/chop_lump/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var CatFileChopLumpConfig = shared.TransformerConfig{ - TransformerName: constants.CatFileChopLumpLabel, - ContractAddresses: []string{constants.CatContractAddress}, - ContractAbi: constants.CatABI, - Topic: constants.CatFileChopLumpSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetCatFileChopLumpConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.CatFileChopLumpLabel, + ContractAddresses: []string{constants.CatContractAddress()}, + ContractAbi: constants.CatABI(), + Topic: constants.GetCatFileChopLumpSignature(), + StartingBlockNumber: constants.CatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/cat_file/flip/config.go b/pkg/transformers/cat_file/flip/config.go index 1fa087d3..da68df8b 100644 --- a/pkg/transformers/cat_file/flip/config.go +++ b/pkg/transformers/cat_file/flip/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var CatFileFlipConfig = shared.TransformerConfig{ - TransformerName: constants.CatFileFlipLabel, - ContractAddresses: []string{constants.CatContractAddress}, - ContractAbi: constants.CatABI, - Topic: constants.CatFileFlipSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetCatFileFlipConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.CatFileFlipLabel, + ContractAddresses: []string{constants.CatContractAddress()}, + ContractAbi: constants.CatABI(), + Topic: constants.GetCatFileFlipSignature(), + StartingBlockNumber: constants.CatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/cat_file/pit_vow/config.go b/pkg/transformers/cat_file/pit_vow/config.go index 2f1eab2e..b06b1cad 100644 --- a/pkg/transformers/cat_file/pit_vow/config.go +++ b/pkg/transformers/cat_file/pit_vow/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var CatFilePitVowConfig = shared.TransformerConfig{ - TransformerName: constants.CatFilePitVowLabel, - ContractAddresses: []string{constants.CatContractAddress}, - ContractAbi: constants.CatABI, - Topic: constants.CatFilePitVowSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetCatFilePitVowConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.CatFilePitVowLabel, + ContractAddresses: []string{constants.CatContractAddress()}, + ContractAbi: constants.CatABI(), + Topic: constants.GetCatFilePitVowSignature(), + StartingBlockNumber: constants.CatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/deal/config.go b/pkg/transformers/deal/config.go index 9deee7d1..43f232ee 100644 --- a/pkg/transformers/deal/config.go +++ b/pkg/transformers/deal/config.go @@ -19,11 +19,14 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DealConfig = shared.TransformerConfig{ - TransformerName: constants.DealLabel, - ContractAddresses: []string{constants.FlapperContractAddress, constants.FlipperContractAddress, constants.FlopperContractAddress}, - ContractAbi: constants.FlipperABI, - Topic: constants.DealSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDealConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.DealLabel, + ContractAddresses: []string{constants.FlapperContractAddress(), constants.FlipperContractAddress(), constants.FlopperContractAddress()}, + ContractAbi: constants.FlipperABI(), + Topic: constants.GetDealSignature(), + StartingBlockNumber: shared.MinInt64([]int64{ + constants.FlapperDeploymentBlock(), constants.FlipperDeploymentBlock(), constants.FlopperDeploymentBlock()}), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/dent/config.go b/pkg/transformers/dent/config.go index 382e1ae4..681dbf43 100644 --- a/pkg/transformers/dent/config.go +++ b/pkg/transformers/dent/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DentConfig = shared.TransformerConfig{ - TransformerName: constants.DentLabel, - ContractAddresses: []string{constants.FlipperContractAddress, constants.FlopperContractAddress}, - ContractAbi: constants.FlipperABI, - Topic: constants.DentFunctionSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDentConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.DentLabel, + ContractAddresses: []string{constants.FlipperContractAddress(), constants.FlopperContractAddress()}, + ContractAbi: constants.FlipperABI(), + Topic: constants.GetDentFunctionSignature(), + StartingBlockNumber: shared.MinInt64([]int64{constants.FlipperDeploymentBlock(), constants.FlopperDeploymentBlock()}), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/drip_drip/config.go b/pkg/transformers/drip_drip/config.go index 7e9677b4..92f3a61f 100644 --- a/pkg/transformers/drip_drip/config.go +++ b/pkg/transformers/drip_drip/config.go @@ -19,11 +19,12 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DripDripConfig = shared.TransformerConfig{ - TransformerName: constants.DripDripLabel, - ContractAddresses: []string{constants.DripContractAddress}, - ContractAbi: constants.DripABI, - Topic: constants.DripDripSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDripDripConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + ContractAddresses: []string{constants.DripContractAddress()}, + ContractAbi: constants.DripABI(), + Topic: constants.GetDripDripSignature(), + StartingBlockNumber: constants.DripDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/drip_file/ilk/config.go b/pkg/transformers/drip_file/ilk/config.go index b7fa0b54..95642b49 100644 --- a/pkg/transformers/drip_file/ilk/config.go +++ b/pkg/transformers/drip_file/ilk/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DripFileIlkConfig = shared.TransformerConfig{ - TransformerName: constants.DripFileIlkLabel, - ContractAddresses: []string{constants.DripContractAddress}, - ContractAbi: constants.DripABI, - Topic: constants.DripFileIlkSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDripFileIlkConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.DripFileIlkLabel, + ContractAddresses: []string{constants.DripContractAddress()}, + ContractAbi: constants.DripABI(), + Topic: constants.GetDripFileIlkSignature(), + StartingBlockNumber: constants.DripDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/drip_file/repo/config.go b/pkg/transformers/drip_file/repo/config.go index cc8e4008..595e4f7c 100644 --- a/pkg/transformers/drip_file/repo/config.go +++ b/pkg/transformers/drip_file/repo/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DripFileRepoConfig = shared.TransformerConfig{ - TransformerName: constants.DripFileRepoLabel, - ContractAddresses: []string{constants.DripContractAddress}, - ContractAbi: constants.DripABI, - Topic: constants.DripFileRepoSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDripFileRepoConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.DripFileRepoLabel, + ContractAddresses: []string{constants.DripContractAddress()}, + ContractAbi: constants.DripABI(), + Topic: constants.GetDripFileRepoSignature(), + StartingBlockNumber: constants.DripDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/drip_file/vow/config.go b/pkg/transformers/drip_file/vow/config.go index 808f1c6c..39d66eb2 100644 --- a/pkg/transformers/drip_file/vow/config.go +++ b/pkg/transformers/drip_file/vow/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DripFileVowConfig = shared.TransformerConfig{ - TransformerName: constants.DripFileVowLabel, - ContractAddresses: []string{constants.DripContractAddress}, - ContractAbi: constants.DripABI, - Topic: constants.DripFileVowSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDripFileVowConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.DripFileVowLabel, + ContractAddresses: []string{constants.DripContractAddress()}, + ContractAbi: constants.DripABI(), + Topic: constants.GetDripFileVowSignature(), + StartingBlockNumber: constants.DripDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/flap_kick/config.go b/pkg/transformers/flap_kick/config.go index f4872a4d..afac5db2 100644 --- a/pkg/transformers/flap_kick/config.go +++ b/pkg/transformers/flap_kick/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var FlapKickConfig = shared.TransformerConfig{ - TransformerName: constants.FlapKickLabel, - ContractAddresses: []string{constants.FlapperContractAddress}, - ContractAbi: constants.FlapperABI, - Topic: constants.FlapKickSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetFlapKickConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.FlapKickLabel, + ContractAddresses: []string{constants.FlapperContractAddress()}, + ContractAbi: constants.FlapperABI(), + Topic: constants.GetFlapKickSignature(), + StartingBlockNumber: constants.FlapperDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/flap_kick/converter_test.go b/pkg/transformers/flap_kick/converter_test.go index 737f1189..237ce910 100644 --- a/pkg/transformers/flap_kick/converter_test.go +++ b/pkg/transformers/flap_kick/converter_test.go @@ -20,7 +20,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/flap_kick" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "math/big" "time" @@ -31,7 +30,7 @@ var _ = Describe("Flap kick converter", func() { Describe("ToEntity", func() { It("converts an Eth Log to a FlapKickEntity", func() { - entities, err := converter.ToEntities(constants.FlapperABI, []types.Log{test_data.EthFlapKickLog}) + entities, err := converter.ToEntities(test_data.KovanFlapperABI, []types.Log{test_data.EthFlapKickLog}) Expect(err).NotTo(HaveOccurred()) Expect(len(entities)).To(Equal(1)) diff --git a/pkg/transformers/flip_kick/config.go b/pkg/transformers/flip_kick/config.go index a3c2e1f8..f83f95b9 100644 --- a/pkg/transformers/flip_kick/config.go +++ b/pkg/transformers/flip_kick/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var FlipKickConfig = shared.TransformerConfig{ - TransformerName: constants.FlipKickLabel, - ContractAddresses: []string{constants.FlipperContractAddress}, - ContractAbi: constants.FlipperABI, - Topic: constants.FlipKickSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetFlipKickConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.FlipKickLabel, + ContractAddresses: []string{constants.FlipperContractAddress()}, + ContractAbi: constants.FlipperABI(), + Topic: constants.GetFlipKickSignature(), + StartingBlockNumber: constants.FlipperDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/flip_kick/converter_test.go b/pkg/transformers/flip_kick/converter_test.go index bd2cff9b..466bf6bc 100644 --- a/pkg/transformers/flip_kick/converter_test.go +++ b/pkg/transformers/flip_kick/converter_test.go @@ -24,7 +24,6 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/flip_kick" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" ) @@ -33,7 +32,7 @@ var _ = Describe("FlipKick Converter", func() { Describe("ToEntity", func() { It("converts an Eth Log to a FlipKickEntity", func() { - entities, err := converter.ToEntities(constants.FlipperABI, []types.Log{test_data.EthFlipKickLog}) + entities, err := converter.ToEntities(test_data.KovanFlipperABI, []types.Log{test_data.EthFlipKickLog}) Expect(err).NotTo(HaveOccurred()) Expect(len(entities)).To(Equal(1)) diff --git a/pkg/transformers/flop_kick/config.go b/pkg/transformers/flop_kick/config.go index d15422c8..860a7647 100644 --- a/pkg/transformers/flop_kick/config.go +++ b/pkg/transformers/flop_kick/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var Config = shared.TransformerConfig{ - TransformerName: constants.FlopKickLabel, - ContractAddresses: []string{constants.FlopperContractAddress}, - ContractAbi: constants.FlopperABI, - Topic: constants.FlopKickSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetFlopKickConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.FlopKickLabel, + ContractAddresses: []string{constants.FlopperContractAddress()}, + ContractAbi: constants.FlopperABI(), + Topic: constants.GetFlopKickSignature(), + StartingBlockNumber: constants.FlopperDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/flop_kick/converter_test.go b/pkg/transformers/flop_kick/converter_test.go index 67b6a321..7f1af4f7 100644 --- a/pkg/transformers/flop_kick/converter_test.go +++ b/pkg/transformers/flop_kick/converter_test.go @@ -23,7 +23,6 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/flop_kick" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" ) @@ -31,7 +30,7 @@ var _ = Describe("FlopKick Converter", func() { Describe("ToEntities", func() { It("converts a log to a FlopKick entity", func() { converter := flop_kick.FlopKickConverter{} - entities, err := converter.ToEntities(constants.FlopperABI, []types.Log{test_data.FlopKickLog}) + entities, err := converter.ToEntities(test_data.KovanFlopperABI, []types.Log{test_data.FlopKickLog}) Expect(err).NotTo(HaveOccurred()) entity := entities[0] diff --git a/pkg/transformers/frob/config.go b/pkg/transformers/frob/config.go index 0e2aad0d..d740a37c 100644 --- a/pkg/transformers/frob/config.go +++ b/pkg/transformers/frob/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var FrobConfig = shared.TransformerConfig{ - TransformerName: constants.FrobLabel, - ContractAddresses: []string{constants.PitContractAddress}, - ContractAbi: constants.PitABI, - Topic: constants.FrobSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetFrobConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.FrobLabel, + ContractAddresses: []string{constants.PitContractAddress()}, + ContractAbi: constants.PitABI(), + Topic: constants.GetFrobSignature(), + StartingBlockNumber: constants.PitDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/frob/converter_test.go b/pkg/transformers/frob/converter_test.go index 39707524..ce235350 100644 --- a/pkg/transformers/frob/converter_test.go +++ b/pkg/transformers/frob/converter_test.go @@ -20,14 +20,13 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/frob" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" ) var _ = Describe("Frob converter", func() { var converter = frob.FrobConverter{} It("converts a log to an entity", func() { - entities, err := converter.ToEntities(constants.PitABI, []types.Log{test_data.EthFrobLog}) + entities, err := converter.ToEntities(test_data.KovanPitABI, []types.Log{test_data.EthFrobLog}) Expect(err).NotTo(HaveOccurred()) Expect(len(entities)).To(Equal(1)) diff --git a/pkg/transformers/integration_tests/bite.go b/pkg/transformers/integration_tests/bite.go index 106f7c4f..57225719 100644 --- a/pkg/transformers/integration_tests/bite.go +++ b/pkg/transformers/integration_tests/bite.go @@ -30,10 +30,19 @@ import ( "github.com/vulcanize/vulcanizedb/test_config" ) +var testBiteConfig = shared.TransformerConfig{ + TransformerName: constants.BiteLabel, + ContractAddresses: []string{test_data.KovanCatContractAddress}, + ContractAbi: test_data.KovanCatABI, + Topic: test_data.KovanBiteSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, +} + var _ = Describe("Bite Transformer", func() { It("fetches and transforms a Bite event from Kovan chain", func() { blockNumber := int64(8956422) - config := bite.BiteConfig + config := testBiteConfig config.StartingBlockNumber = blockNumber config.EndingBlockNumber = blockNumber @@ -80,8 +89,8 @@ var _ = Describe("Bite Transformer", func() { }) It("unpacks an event log", func() { - address := common.HexToAddress(constants.CatContractAddress) - abi, err := geth.ParseAbi(constants.CatABI) + address := common.HexToAddress(test_data.KovanCatContractAddress) + abi, err := geth.ParseAbi(test_data.KovanCatABI) Expect(err).NotTo(HaveOccurred()) contract := bind.NewBoundContract(address, abi, nil, nil, nil) diff --git a/pkg/transformers/integration_tests/cat_file.go b/pkg/transformers/integration_tests/cat_file.go index 06679e83..bf75b730 100644 --- a/pkg/transformers/integration_tests/cat_file.go +++ b/pkg/transformers/integration_tests/cat_file.go @@ -18,6 +18,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "sort" "github.com/ethereum/go-ethereum/ethclient" @@ -61,9 +63,14 @@ var _ = Describe("Cat File transformer", func() { header, err := persistHeader(db, chopLumpBlockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) - config := chop_lump.CatFileChopLumpConfig - config.StartingBlockNumber = chopLumpBlockNumber - config.EndingBlockNumber = chopLumpBlockNumber + config := shared.TransformerConfig{ + TransformerName: constants.CatFileChopLumpLabel, + ContractAddresses: []string{test_data.KovanCatContractAddress}, + ContractAbi: test_data.KovanCatABI, + Topic: test_data.KovanCatFileChopLumpSignature, + StartingBlockNumber: chopLumpBlockNumber, + EndingBlockNumber: chopLumpBlockNumber, + } initializer := factories.LogNoteTransformer{ Config: config, @@ -105,9 +112,14 @@ var _ = Describe("Cat File transformer", func() { header, err := persistHeader(db, flipBlockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) - config := flip.CatFileFlipConfig - config.StartingBlockNumber = flipBlockNumber - config.EndingBlockNumber = flipBlockNumber + config := shared.TransformerConfig{ + TransformerName: constants.CatFileFlipLabel, + ContractAddresses: []string{test_data.KovanCatContractAddress}, + ContractAbi: test_data.KovanCatABI, + Topic: test_data.KovanCatFileFlipSignature, + StartingBlockNumber: flipBlockNumber, + EndingBlockNumber: flipBlockNumber, + } initializer := factories.LogNoteTransformer{ Config: config, @@ -142,9 +154,14 @@ var _ = Describe("Cat File transformer", func() { header, err := persistHeader(db, pitVowBlockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) - config := pit_vow.CatFilePitVowConfig - config.StartingBlockNumber = pitVowBlockNumber - config.EndingBlockNumber = pitVowBlockNumber + config := shared.TransformerConfig{ + TransformerName: constants.CatFilePitVowLabel, + ContractAddresses: []string{test_data.KovanCatContractAddress}, + ContractAbi: test_data.KovanCatABI, + Topic: test_data.KovanCatFilePitVowSignature, + StartingBlockNumber: pitVowBlockNumber, + EndingBlockNumber: pitVowBlockNumber, + } initializer := factories.LogNoteTransformer{ Config: config, diff --git a/pkg/transformers/integration_tests/deal.go b/pkg/transformers/integration_tests/deal.go index b010cced..dda8c3f8 100644 --- a/pkg/transformers/integration_tests/deal.go +++ b/pkg/transformers/integration_tests/deal.go @@ -18,13 +18,14 @@ import ( "github.com/ethereum/go-ethereum/common" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" "github.com/vulcanize/vulcanizedb/pkg/transformers/deal" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/test_config" ) @@ -47,7 +48,14 @@ var _ = Describe("Deal transformer", func() { db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) - config = deal.DealConfig + config = shared.TransformerConfig{ + TransformerName: constants.DealLabel, + ContractAddresses: []string{test_data.KovanFlapperContractAddress, test_data.KovanFlipperContractAddress, test_data.KovanFlopperContractAddress}, + ContractAbi: test_data.KovanFlipperABI, + Topic: test_data.KovanDealSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } initializer = factories.LogNoteTransformer{ Config: config, @@ -83,7 +91,7 @@ var _ = Describe("Deal transformer", func() { Expect(len(dbResult)).To(Equal(1)) Expect(dbResult[0].BidId).To(Equal("6")) - Expect(dbResult[0].ContractAddress).To(Equal(constants.FlipperContractAddress)) + Expect(dbResult[0].ContractAddress).To(Equal(test_data.KovanFlipperContractAddress)) }) It("persists a flop deal log event", func() { @@ -111,6 +119,6 @@ var _ = Describe("Deal transformer", func() { Expect(len(dbResult)).To(Equal(1)) Expect(dbResult[0].BidId).To(Equal("1")) - Expect(dbResult[0].ContractAddress).To(Equal(constants.FlapperContractAddress)) + Expect(dbResult[0].ContractAddress).To(Equal(test_data.KovanFlapperContractAddress)) }) }) diff --git a/pkg/transformers/integration_tests/dent.go b/pkg/transformers/integration_tests/dent.go index d1c8050c..9097da6a 100644 --- a/pkg/transformers/integration_tests/dent.go +++ b/pkg/transformers/integration_tests/dent.go @@ -5,6 +5,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" @@ -34,7 +35,15 @@ var _ = Describe("Dent transformer", func() { db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) - config = dent.DentConfig + config = shared.TransformerConfig{ + TransformerName: constants.DentLabel, + ContractAddresses: []string{test_data.KovanFlipperContractAddress, test_data.KovanFlopperContractAddress}, + ContractAbi: test_data.KovanFlipperABI, + Topic: test_data.KovanDentFunctionSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } + addresses = shared.HexStringsToAddresses(config.ContractAddresses) topics = []common.Hash{common.HexToHash(config.Topic)} fetcher = shared.NewFetcher(blockChain) diff --git a/pkg/transformers/integration_tests/drip_drip.go b/pkg/transformers/integration_tests/drip_drip.go index 783616f0..dce5fe32 100644 --- a/pkg/transformers/integration_tests/drip_drip.go +++ b/pkg/transformers/integration_tests/drip_drip.go @@ -22,6 +22,7 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_drip" "github.com/vulcanize/vulcanizedb/test_config" @@ -31,6 +32,7 @@ var _ = Describe("DripDrip Transformer", func() { var ( db *postgres.DB blockChain core.BlockChain + config shared.TransformerConfig ) BeforeEach(func() { @@ -40,10 +42,18 @@ var _ = Describe("DripDrip Transformer", func() { Expect(err).NotTo(HaveOccurred()) db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) + + config = shared.TransformerConfig{ + ContractAddresses: []string{test_data.KovanDripContractAddress}, + ContractAbi: test_data.KovanDripABI, + Topic: test_data.KovanDripDripSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } }) + It("transforms DripDrip log events", func() { blockNumber := int64(8934775) - config := drip_drip.DripDripConfig config.StartingBlockNumber = blockNumber config.EndingBlockNumber = blockNumber diff --git a/pkg/transformers/integration_tests/drip_file_vow.go b/pkg/transformers/integration_tests/drip_file_vow.go index 3f2f065b..f3ebb494 100644 --- a/pkg/transformers/integration_tests/drip_file_vow.go +++ b/pkg/transformers/integration_tests/drip_file_vow.go @@ -22,6 +22,8 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/vow" "github.com/vulcanize/vulcanizedb/test_config" @@ -44,9 +46,14 @@ var _ = Describe("Drip File Vow LogNoteTransformer", func() { It("transforms DripFileVow log events", func() { blockNumber := int64(8762197) - config := vow.DripFileVowConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.DripFileVowLabel, + ContractAddresses: []string{test_data.KovanDripContractAddress}, + ContractAbi: test_data.KovanDripABI, + Topic: test_data.KovanDripFileVowSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/flap_kick.go b/pkg/transformers/integration_tests/flap_kick.go index f7ddee53..ef270b5e 100644 --- a/pkg/transformers/integration_tests/flap_kick.go +++ b/pkg/transformers/integration_tests/flap_kick.go @@ -18,6 +18,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/test_config" "time" @@ -46,9 +48,14 @@ var _ = Describe("FlapKick Transformer", func() { It("fetches and transforms a FlapKick event from Kovan chain", func() { blockNumber := int64(9002933) - config := flap_kick.FlapKickConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.FlapKickLabel, + ContractAddresses: []string{test_data.KovanFlapperContractAddress}, + ContractAbi: test_data.KovanFlapperABI, + Topic: test_data.KovanFlapKickSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/flip_kick.go b/pkg/transformers/integration_tests/flip_kick.go index 598542d4..fa86e285 100644 --- a/pkg/transformers/integration_tests/flip_kick.go +++ b/pkg/transformers/integration_tests/flip_kick.go @@ -33,8 +33,8 @@ import ( var _ = Describe("FlipKick Transformer", func() { It("unpacks an event log", func() { - address := common.HexToAddress(constants.FlipperContractAddress) - abi, err := geth.ParseAbi(constants.FlipperABI) + address := common.HexToAddress(test_data.KovanFlipperContractAddress) + abi, err := geth.ParseAbi(test_data.KovanFlipperABI) Expect(err).NotTo(HaveOccurred()) contract := bind.NewBoundContract(address, abi, nil, nil, nil) @@ -57,9 +57,14 @@ var _ = Describe("FlipKick Transformer", func() { It("fetches and transforms a FlipKick event from Kovan chain", func() { blockNumber := int64(8956476) - config := flip_kick.FlipKickConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.FlipKickLabel, + ContractAddresses: []string{test_data.KovanFlipperContractAddress}, + ContractAbi: test_data.KovanFlipperABI, + Topic: test_data.KovanFlipKickSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/flop_kick.go b/pkg/transformers/integration_tests/flop_kick.go index 6ecab800..66537139 100644 --- a/pkg/transformers/integration_tests/flop_kick.go +++ b/pkg/transformers/integration_tests/flop_kick.go @@ -52,7 +52,14 @@ var _ = Describe("FlopKick Transformer", func() { db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) - config = flop_kick.Config + config = shared.TransformerConfig{ + TransformerName: constants.FlopKickLabel, + ContractAddresses: []string{test_data.KovanFlopperContractAddress}, + ContractAbi: test_data.KovanFlopperABI, + Topic: test_data.KovanFlopKickSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } initializer = factories.Transformer{ Config: config, @@ -121,8 +128,8 @@ var _ = Describe("FlopKick Transformer", func() { }) It("unpacks an flop kick event log", func() { - address := common.HexToAddress(constants.FlopperContractAddress) - abi, err := geth.ParseAbi(constants.FlopperABI) + address := common.HexToAddress(test_data.KovanFlopperContractAddress) + abi, err := geth.ParseAbi(test_data.KovanFlopperABI) Expect(err).NotTo(HaveOccurred()) contract := bind.NewBoundContract(address, abi, nil, nil, nil) diff --git a/pkg/transformers/integration_tests/frob.go b/pkg/transformers/integration_tests/frob.go index 50cde0a0..85697466 100644 --- a/pkg/transformers/integration_tests/frob.go +++ b/pkg/transformers/integration_tests/frob.go @@ -49,7 +49,15 @@ var _ = Describe("Frob Transformer", func() { test_config.CleanTestDB(db) fetcher = shared.NewFetcher(blockChain) - config = frob.FrobConfig + config = shared.TransformerConfig{ + TransformerName: constants.FrobLabel, + ContractAddresses: []string{test_data.KovanPitContractAddress}, + ContractAbi: test_data.KovanPitABI, + Topic: test_data.KovanFrobSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } + initializer = factories.Transformer{ Config: config, Converter: &frob.FrobConverter{}, @@ -90,8 +98,8 @@ var _ = Describe("Frob Transformer", func() { }) It("unpacks an event log", func() { - address := common.HexToAddress(constants.PitContractAddress) - abi, err := geth.ParseAbi(constants.PitABI) + address := common.HexToAddress(test_data.KovanPitContractAddress) + abi, err := geth.ParseAbi(test_data.KovanPitABI) Expect(err).NotTo(HaveOccurred()) contract := bind.NewBoundContract(address, abi, nil, nil, nil) diff --git a/pkg/transformers/integration_tests/pit_file_debt_ceiling.go b/pkg/transformers/integration_tests/pit_file_debt_ceiling.go index e1b088a3..38dfe2ae 100644 --- a/pkg/transformers/integration_tests/pit_file_debt_ceiling.go +++ b/pkg/transformers/integration_tests/pit_file_debt_ceiling.go @@ -22,6 +22,8 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/debt_ceiling" "github.com/vulcanize/vulcanizedb/test_config" @@ -44,9 +46,14 @@ var _ = Describe("PitFileDebtCeiling LogNoteTransformer", func() { It("fetches and transforms a PitFileDebtCeiling event from Kovan chain", func() { blockNumber := int64(8535578) - config := debt_ceiling.DebtCeilingFileConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.PitFileDebtCeilingLabel, + ContractAddresses: []string{test_data.KovanPitContractAddress}, + ContractAbi: test_data.KovanPitABI, + Topic: test_data.KovanPitFileDebtCeilingSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/pit_file_ilk.go b/pkg/transformers/integration_tests/pit_file_ilk.go index ab713a94..a5e0ac88 100644 --- a/pkg/transformers/integration_tests/pit_file_ilk.go +++ b/pkg/transformers/integration_tests/pit_file_ilk.go @@ -20,6 +20,8 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/ilk" @@ -43,7 +45,14 @@ var _ = Describe("PitFileIlk LogNoteTransformer", func() { Expect(err).NotTo(HaveOccurred()) db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) - config := ilk.IlkFileConfig + config := shared.TransformerConfig{ + TransformerName: constants.PitFileIlkLabel, + ContractAddresses: []string{test_data.KovanPitContractAddress}, + ContractAbi: test_data.KovanPitABI, + Topic: test_data.KovanPitFileIlkSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } addresses = shared.HexStringsToAddresses(config.ContractAddresses) topics = []common.Hash{common.HexToHash(config.Topic)} diff --git a/pkg/transformers/integration_tests/price_feeds.go b/pkg/transformers/integration_tests/price_feeds.go index fac1f71d..e36baf1c 100644 --- a/pkg/transformers/integration_tests/price_feeds.go +++ b/pkg/transformers/integration_tests/price_feeds.go @@ -18,13 +18,14 @@ import ( "github.com/ethereum/go-ethereum/common" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/price_feeds" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/test_config" ) @@ -46,7 +47,19 @@ var _ = Describe("Price feeds transformer", func() { db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) - config = price_feeds.PriceFeedConfig + config = shared.TransformerConfig{ + TransformerName: constants.PriceFeedLabel, + ContractAddresses: []string{ + test_data.KovanPepContractAddress, + test_data.KovanPipContractAddress, + test_data.KovanRepContractAddress, + }, + ContractAbi: test_data.KovanMedianizerABI, + Topic: test_data.KovanLogValueSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } + topics = []common.Hash{common.HexToHash(config.Topic)} fetcher = shared.NewFetcher(blockChain) @@ -62,7 +75,7 @@ var _ = Describe("Price feeds transformer", func() { blockNumber := int64(8763054) header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) - addresses := []string{constants.PipContractAddress} + addresses := []string{test_data.KovanPipContractAddress} initializer.Config.ContractAddresses = addresses initializer.Config.StartingBlockNumber = blockNumber initializer.Config.EndingBlockNumber = blockNumber @@ -88,7 +101,7 @@ var _ = Describe("Price feeds transformer", func() { blockNumber := int64(8763059) header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) - addresses := []string{constants.PepContractAddress} + addresses := []string{test_data.KovanPepContractAddress} initializer.Config.ContractAddresses = addresses initializer.Config.StartingBlockNumber = blockNumber initializer.Config.EndingBlockNumber = blockNumber @@ -114,7 +127,7 @@ var _ = Describe("Price feeds transformer", func() { blockNumber := int64(8763062) header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) - addresses := []string{constants.RepContractAddress} + addresses := []string{test_data.KovanRepContractAddress} initializer.Config.ContractAddresses = addresses initializer.Config.StartingBlockNumber = blockNumber initializer.Config.EndingBlockNumber = blockNumber diff --git a/pkg/transformers/integration_tests/tend.go b/pkg/transformers/integration_tests/tend.go index ae6938ba..83398ccb 100644 --- a/pkg/transformers/integration_tests/tend.go +++ b/pkg/transformers/integration_tests/tend.go @@ -24,6 +24,7 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/tend" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/test_config" ) @@ -46,7 +47,14 @@ var _ = Describe("Tend LogNoteTransformer", func() { db = test_config.NewTestDB(blockChain.Node()) test_config.CleanTestDB(db) - config = tend.TendConfig + config = shared.TransformerConfig{ + TransformerName: constants.TendLabel, + ContractAddresses: []string{test_data.KovanFlapperContractAddress, test_data.KovanFlipperContractAddress}, + ContractAbi: test_data.KovanFlipperABI, + Topic: test_data.KovanTendFunctionSignature, + StartingBlockNumber: 0, + EndingBlockNumber: -1, + } fetcher = shared.NewFetcher(blockChain) addresses = shared.HexStringsToAddresses(config.ContractAddresses) diff --git a/pkg/transformers/integration_tests/vat_flux.go b/pkg/transformers/integration_tests/vat_flux.go index 04ecb129..c379c07f 100644 --- a/pkg/transformers/integration_tests/vat_flux.go +++ b/pkg/transformers/integration_tests/vat_flux.go @@ -18,6 +18,8 @@ import ( "github.com/ethereum/go-ethereum/common" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" @@ -28,9 +30,14 @@ import ( var _ = Describe("VatFlux LogNoteTransformer", func() { It("transforms VatFlux log events", func() { blockNumber := int64(9004474) - config := vat_flux.VatFluxConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatFluxLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatFluxSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_fold.go b/pkg/transformers/integration_tests/vat_fold.go index 7458d7dd..eb60e7e6 100644 --- a/pkg/transformers/integration_tests/vat_fold.go +++ b/pkg/transformers/integration_tests/vat_fold.go @@ -20,6 +20,8 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/test_config" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" @@ -44,9 +46,14 @@ var _ = Describe("VatFold Transformer", func() { It("transforms VatFold log events", func() { blockNumber := int64(9367233) - config := vat_fold.VatFoldConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatFoldLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatFoldSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_grab.go b/pkg/transformers/integration_tests/vat_grab.go index f43346f2..77c4c3d5 100644 --- a/pkg/transformers/integration_tests/vat_grab.go +++ b/pkg/transformers/integration_tests/vat_grab.go @@ -16,6 +16,8 @@ package integration_tests import ( "github.com/ethereum/go-ethereum/common" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "math/big" . "github.com/onsi/ginkgo" @@ -30,9 +32,14 @@ import ( var _ = Describe("Vat Grab Transformer", func() { It("transforms VatGrab log events", func() { blockNumber := int64(8958230) - config := vat_grab.VatGrabConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatGrabLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatGrabSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_heal.go b/pkg/transformers/integration_tests/vat_heal.go index e787b642..93393e44 100644 --- a/pkg/transformers/integration_tests/vat_heal.go +++ b/pkg/transformers/integration_tests/vat_heal.go @@ -18,6 +18,8 @@ import ( "github.com/ethereum/go-ethereum/common" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" @@ -28,9 +30,14 @@ import ( var _ = Describe("VatHeal Transformer", func() { It("transforms VatHeal log events", func() { blockNumber := int64(8935578) - config := vat_heal.VatHealConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatHealLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatHealSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_init.go b/pkg/transformers/integration_tests/vat_init.go index e31c3aa4..47a24388 100644 --- a/pkg/transformers/integration_tests/vat_init.go +++ b/pkg/transformers/integration_tests/vat_init.go @@ -20,6 +20,8 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_init" "github.com/vulcanize/vulcanizedb/test_config" @@ -28,9 +30,14 @@ import ( var _ = Describe("VatInit LogNoteTransformer", func() { It("transforms VatInit log events", func() { blockNumber := int64(8535561) - config := vat_init.VatInitConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatInitLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatInitSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_move.go b/pkg/transformers/integration_tests/vat_move.go index 3ed85452..5ffa97f4 100644 --- a/pkg/transformers/integration_tests/vat_move.go +++ b/pkg/transformers/integration_tests/vat_move.go @@ -20,6 +20,8 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_move" "github.com/vulcanize/vulcanizedb/test_config" @@ -28,9 +30,14 @@ import ( var _ = Describe("VatMove LogNoteTransformer", func() { It("transforms VatMove log events", func() { blockNumber := int64(9004628) - config := vat_move.VatMoveConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatMoveLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatMoveSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_slip.go b/pkg/transformers/integration_tests/vat_slip.go index de937cca..28a4b160 100644 --- a/pkg/transformers/integration_tests/vat_slip.go +++ b/pkg/transformers/integration_tests/vat_slip.go @@ -4,6 +4,8 @@ import ( "github.com/ethereum/go-ethereum/common" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" @@ -30,9 +32,14 @@ var _ = Describe("Vat slip transformer", func() { It("persists vat slip event", func() { blockNumber := int64(8953655) - config := vat_slip.VatSlipConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatSlipLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatSlipSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vat_tune.go b/pkg/transformers/integration_tests/vat_tune.go index 6a794867..6f81cdf9 100644 --- a/pkg/transformers/integration_tests/vat_tune.go +++ b/pkg/transformers/integration_tests/vat_tune.go @@ -16,6 +16,8 @@ package integration_tests import ( "github.com/ethereum/go-ethereum/common" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "math/big" . "github.com/onsi/ginkgo" @@ -30,9 +32,14 @@ import ( var _ = Describe("VatTune LogNoteTransformer", func() { It("transforms VatTune log events", func() { blockNumber := int64(8761670) - config := vat_tune.VatTuneConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VatTuneLabel, + ContractAddresses: []string{test_data.KovanVatContractAddress}, + ContractAbi: test_data.KovanVatABI, + Topic: test_data.KovanVatTuneSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } rpcClient, ethClient, err := getClients(ipc) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/integration_tests/vow_flog.go b/pkg/transformers/integration_tests/vow_flog.go index 494b4326..c7c39359 100644 --- a/pkg/transformers/integration_tests/vow_flog.go +++ b/pkg/transformers/integration_tests/vow_flog.go @@ -20,6 +20,8 @@ import ( . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/core" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" + "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" "github.com/vulcanize/vulcanizedb/pkg/transformers/factories" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" @@ -44,9 +46,14 @@ var _ = Describe("VowFlog LogNoteTransformer", func() { It("transforms VowFlog log events", func() { blockNumber := int64(8946819) - config := vow_flog.VowFlogConfig - config.StartingBlockNumber = blockNumber - config.EndingBlockNumber = blockNumber + config := shared.TransformerConfig{ + TransformerName: constants.VowFlogLabel, + ContractAddresses: []string{test_data.KovanVowContractAddress}, + ContractAbi: test_data.KovanVowABI, + Topic: test_data.KovanVowFlogSignature, + StartingBlockNumber: blockNumber, + EndingBlockNumber: blockNumber, + } header, err := persistHeader(db, blockNumber, blockChain) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/transformers/pit_file/debt_ceiling/config.go b/pkg/transformers/pit_file/debt_ceiling/config.go index eb6ac8f9..d76d2da0 100644 --- a/pkg/transformers/pit_file/debt_ceiling/config.go +++ b/pkg/transformers/pit_file/debt_ceiling/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var DebtCeilingFileConfig = shared.TransformerConfig{ - TransformerName: constants.PitFileDebtCeilingLabel, - ContractAddresses: []string{constants.PitContractAddress}, - ContractAbi: constants.PitABI, - Topic: constants.PitFileDebtCeilingSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetDebtCeilingFileConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.PitFileDebtCeilingLabel, + ContractAddresses: []string{constants.PitContractAddress()}, + ContractAbi: constants.PitABI(), + Topic: constants.GetPitFileDebtCeilingSignature(), + StartingBlockNumber: constants.PitDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/pit_file/ilk/config.go b/pkg/transformers/pit_file/ilk/config.go index 74ee47c6..07220752 100644 --- a/pkg/transformers/pit_file/ilk/config.go +++ b/pkg/transformers/pit_file/ilk/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var IlkFileConfig = shared.TransformerConfig{ - TransformerName: constants.PitFileIlkLabel, - ContractAddresses: []string{constants.PitContractAddress}, - ContractAbi: constants.PitABI, - Topic: constants.PitFileIlkSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetIlkFileConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.PitFileIlkLabel, + ContractAddresses: []string{constants.PitContractAddress()}, + ContractAbi: constants.PitABI(), + Topic: constants.GetPitFileIlkSignature(), + StartingBlockNumber: constants.PitDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/price_feeds/config.go b/pkg/transformers/price_feeds/config.go index ccbd7c47..1c9b168b 100644 --- a/pkg/transformers/price_feeds/config.go +++ b/pkg/transformers/price_feeds/config.go @@ -19,15 +19,17 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var PriceFeedConfig = shared.TransformerConfig{ - TransformerName: constants.PriceFeedLabel, - ContractAddresses: []string{ - constants.PepContractAddress, - constants.PipContractAddress, - constants.RepContractAddress, - }, - ContractAbi: constants.MedianizerABI, - Topic: constants.LogValueSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetPriceFeedConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.PriceFeedLabel, + ContractAddresses: []string{ + constants.PepContractAddress(), constants.PipContractAddress(), constants.RepContractAddress(), + }, + ContractAbi: constants.MedianizerABI(), + Topic: constants.GetLogValueSignature(), + StartingBlockNumber: shared.MinInt64([]int64{ + constants.PepDeploymentBlock(), constants.PipDeploymentBlock(), constants.RepDeploymentBlock(), + }), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/shared/constants/abi.go b/pkg/transformers/shared/constants/abi.go deleted file mode 100644 index 82e09bb1..00000000 --- a/pkg/transformers/shared/constants/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -package constants - -var ( - CatABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x626cb3c5"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"flips","outputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"},{"name":"ink","type":"uint256"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x70d9235a"},{"constant":true,"inputs":[],"name":"nflip","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x76181a51"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"flip","type":"address"},{"name":"chop","type":"uint256"},{"name":"lump","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[],"name":"pit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf03c7c6e"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"tab","type":"uint256"},{"indexed":false,"name":"flip","type":"uint256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Bite","type":"event","signature":"0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xebecb39d"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"}],"name":"bite","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x72f7b593"},{"constant":false,"inputs":[{"name":"n","type":"uint256"},{"name":"wad","type":"uint256"}],"name":"flip","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6f95917"}]` - DripABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"repo","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x56ff3122"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"},{"name":"rho","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"drip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x44e2a5a8"}]` - FlapperABI = `[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"gal","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]` - FlipperABI = `[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4423c5f1"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4e8b1dd5"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7bd2bea7"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7d780d82"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfc4af55"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfdd3302"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf4b9fa75"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"tab","type":"uint256"}],"name":"Kick","type":"event","signature":"0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xeae19d9e"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"tick","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xfc7b6aee"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x4b43ed12"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5ff3a382"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xc959c42b"}]` - FlopperABI = `[{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"vow","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]` - MedianizerABI = `[{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"bytes32"}],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"compute","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"indexes","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"next","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"read","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"peek","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes12"}],"name":"values","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"min_","type":"uint96"}],"name":"setMin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"void","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"},{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"next_","type":"bytes12"}],"name":"setNext","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"min","outputs":[{"name":"","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"val","type":"bytes32"}],"name":"LogValue","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]]` - // TODO: replace with updated ABI when contract is deployed (with no pit file stability fee method + modified Frob event) - PitABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[],"name":"drip","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x9f678cca"},{"constant":true,"inputs":[],"name":"Line","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbabe8a3f"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"spot","type":"uint256"},{"name":"line","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"dink","type":"int256"},{"indexed":false,"name":"dart","type":"int256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Frob","type":"event","signature":"0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"frob","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5a984ded"}]` - VatABI = `[{"constant":true,"inputs":[],"name":"debt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x0dca59c1"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"urns","outputs":[{"name":"ink","type":"uint256"},{"name":"art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x26e27482"},{"constant":true,"inputs":[],"name":"vice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x2d61a355"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xa60f1d3e"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"gem","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc0912683"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"take","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"Ink","type":"uint256"},{"name":"Art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"dai","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf53e4e69"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":true,"name":"too","type":"bytes32"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"Note","type":"event","signature":"0x8c2dbbc2b33ffaa77c104b777e574a8a4ff79829dfee8b66f4dc63e3f8067152"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3b663195"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"guy","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"slip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x42066cbb"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"flux","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa6e41821"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x78f19470"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"tune","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5dd6471a"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"grab","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3690ae4c"},{"constant":false,"inputs":[{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x990a5f63"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"rate","type":"int256"}],"name":"fold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6a6a64d"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"take","type":"int256"}],"name":"toll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x09b7a0b5"}]` - VowABI = `[{"constant":true,"inputs":[],"name":"Awe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Joy","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"flap","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"hump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"kiss","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Ash","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"era","type":"uint48"}],"name":"flog","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Woe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wait","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"bump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tab","type":"uint256"}],"name":"fess","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"row","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint48"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"flop","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"addr","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]` -) diff --git a/pkg/transformers/shared/constants/address.go b/pkg/transformers/shared/constants/address.go deleted file mode 100644 index 23cd56c2..00000000 --- a/pkg/transformers/shared/constants/address.go +++ /dev/null @@ -1,26 +0,0 @@ -package constants - -import "github.com/spf13/viper" - -func getContractValue(key string, fallback string) string { - value := viper.GetString(key) - if value == "" { - return fallback - } - return value -} - -var ( - // temporary addresses from Kovan deployment - CatContractAddress = getContractValue("contract.cat", "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0") - DripContractAddress = getContractValue("contract.drip", "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d") - FlapperContractAddress = getContractValue("contract.mcd_flap", "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132") // MCD FLAP Contract - FlipperContractAddress = getContractValue("contract.eth_flip", "0x32D496Ad866D110060866B7125981C73642cc509") // ETH FLIP Contract - FlopperContractAddress = getContractValue("contract.mcd_flop", "0x6191C9b0086c2eBF92300cC507009b53996FbFFa") // MCD FLOP Contract - PepContractAddress = getContractValue("contract.pep", "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975") - PipContractAddress = getContractValue("contract.pip", "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc") - PitContractAddress = getContractValue("contract.pit", "0xe7cf3198787c9a4daac73371a38f29aaeeced87e") - RepContractAddress = getContractValue("contract.rep", "0xf88bBDc1E2718F8857F30A180076ec38d53cf296") - VatContractAddress = getContractValue("contract.vat", "0xcd726790550afcd77e9a7a47e86a3f9010af126b") - VowContractAddress = getContractValue("contract.vow", "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1") -) diff --git a/pkg/transformers/shared/constants/event_signature_generator_test.go b/pkg/transformers/shared/constants/event_signature_generator_test.go index c87a2e07..a31e9d0a 100644 --- a/pkg/transformers/shared/constants/event_signature_generator_test.go +++ b/pkg/transformers/shared/constants/event_signature_generator_test.go @@ -18,6 +18,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" + "github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" ) var _ = Describe("Event signature generator", func() { @@ -93,7 +94,7 @@ var _ = Describe("Event signature generator", func() { Describe("from the cat contract", func() { It("gets the file method signature", func() { expected := "file(bytes32,bytes32,address)" - actual := constants.GetSolidityMethodSignature(constants.CatABI, "file") + actual := constants.GetSolidityMethodSignature(test_data.KovanCatABI, "file") Expect(expected).To(Equal(actual)) }) @@ -102,14 +103,14 @@ var _ = Describe("Event signature generator", func() { Describe("from the drip contract", func() { It("gets the drip method signature", func() { expected := "drip(bytes32)" - actual := constants.GetSolidityMethodSignature(constants.DripABI, "drip") + actual := constants.GetSolidityMethodSignature(test_data.KovanDripABI, "drip") Expect(expected).To(Equal(actual)) }) It("gets the file method signature", func() { expected := "file(bytes32,uint256)" - actual := constants.GetSolidityMethodSignature(constants.DripABI, "file") + actual := constants.GetSolidityMethodSignature(test_data.KovanDripABI, "file") Expect(expected).To(Equal(actual)) }) @@ -118,21 +119,21 @@ var _ = Describe("Event signature generator", func() { Describe("from the flipper contract", func() { It("gets the deal method signature", func() { expected := "deal(uint256)" - actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "deal") + actual := constants.GetSolidityMethodSignature(test_data.KovanFlipperABI, "deal") Expect(expected).To(Equal(actual)) }) It("gets the dent method signature", func() { expected := "dent(uint256,uint256,uint256)" - actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "dent") + actual := constants.GetSolidityMethodSignature(test_data.KovanFlipperABI, "dent") Expect(expected).To(Equal(actual)) }) It("gets the tend method signature", func() { expected := "tend(uint256,uint256,uint256)" - actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "tend") + actual := constants.GetSolidityMethodSignature(test_data.KovanFlipperABI, "tend") Expect(expected).To(Equal(actual)) }) @@ -141,7 +142,7 @@ var _ = Describe("Event signature generator", func() { Describe("from the pit contract", func() { It("gets the file method signature", func() { expected := "file(bytes32,address)" - actual := constants.GetSolidityMethodSignature(constants.PitABI, "file") + actual := constants.GetSolidityMethodSignature(test_data.KovanPitABI, "file") Expect(expected).To(Equal(actual)) }) @@ -150,63 +151,63 @@ var _ = Describe("Event signature generator", func() { Describe("from the vat contract", func() { It("gets the init method signature", func() { expected := "init(bytes32)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "init") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "init") Expect(expected).To(Equal(actual)) }) It("gets the heal method signature", func() { expected := "heal(bytes32,bytes32,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "heal") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "heal") Expect(expected).To(Equal(actual)) }) It("gets the fold method signature", func() { expected := "fold(bytes32,bytes32,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "fold") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "fold") Expect(expected).To(Equal(actual)) }) It("gets the flux method signature", func() { expected := "flux(bytes32,bytes32,bytes32,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "flux") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "flux") Expect(expected).To(Equal(actual)) }) It("gets the grab method signature", func() { expected := "grab(bytes32,bytes32,bytes32,bytes32,int256,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "grab") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "grab") Expect(expected).To(Equal(actual)) }) It("gets the move method signature", func() { expected := "move(bytes32,bytes32,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "move") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "move") Expect(expected).To(Equal(actual)) }) It("gets the slip method signature", func() { expected := "slip(bytes32,bytes32,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "slip") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "slip") Expect(expected).To(Equal(actual)) }) It("gets the toll method signature", func() { expected := "toll(bytes32,bytes32,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "toll") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "toll") Expect(expected).To(Equal(actual)) }) It("gets the tune method signature", func() { expected := "tune(bytes32,bytes32,bytes32,bytes32,int256,int256)" - actual := constants.GetSolidityMethodSignature(constants.VatABI, "tune") + actual := constants.GetSolidityMethodSignature(test_data.KovanVatABI, "tune") Expect(expected).To(Equal(actual)) }) @@ -215,7 +216,7 @@ var _ = Describe("Event signature generator", func() { Describe("from the vow contract", func() { It("gets the flog method signature", func() { expected := "flog(uint48)" - actual := constants.GetSolidityMethodSignature(constants.VowABI, "flog") + actual := constants.GetSolidityMethodSignature(test_data.KovanVowABI, "flog") Expect(expected).To(Equal(actual)) }) @@ -225,42 +226,42 @@ var _ = Describe("Event signature generator", func() { Describe("it handles events", func() { It("gets the Bite event signature", func() { expected := "Bite(bytes32,bytes32,uint256,uint256,uint256,uint256,uint256)" - actual := constants.GetSolidityMethodSignature(constants.CatABI, "Bite") + actual := constants.GetSolidityMethodSignature(test_data.KovanCatABI, "Bite") Expect(expected).To(Equal(actual)) }) It("gets the flap Kick event signature", func() { expected := "Kick(uint256,uint256,uint256,address,uint48)" - actual := constants.GetSolidityMethodSignature(constants.FlapperABI, "Kick") + actual := constants.GetSolidityMethodSignature(test_data.KovanFlapperABI, "Kick") Expect(expected).To(Equal(actual)) }) It("gets the flip Kick event signature", func() { expected := "Kick(uint256,uint256,uint256,address,uint48,bytes32,uint256)" - actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "Kick") + actual := constants.GetSolidityMethodSignature(test_data.KovanFlipperABI, "Kick") Expect(expected).To(Equal(actual)) }) It("gets the flop Kick event signature", func() { expected := "Kick(uint256,uint256,uint256,address,uint48)" - actual := constants.GetSolidityMethodSignature(constants.FlopperABI, "Kick") + actual := constants.GetSolidityMethodSignature(test_data.KovanFlopperABI, "Kick") Expect(expected).To(Equal(actual)) }) It("gets the pit frob event signature", func() { expected := "Frob(bytes32,bytes32,uint256,uint256,int256,int256,uint256)" - actual := constants.GetSolidityMethodSignature(constants.PitABI, "Frob") + actual := constants.GetSolidityMethodSignature(test_data.KovanPitABI, "Frob") Expect(expected).To(Equal(actual)) }) It("gets the log value method signature", func() { expected := "LogValue(bytes32)" - actual := constants.GetSolidityMethodSignature(constants.MedianizerABI, "LogValue") + actual := constants.GetSolidityMethodSignature(test_data.KovanMedianizerABI, "LogValue") Expect(expected).To(Equal(actual)) }) diff --git a/pkg/transformers/shared/constants/external.go b/pkg/transformers/shared/constants/external.go new file mode 100644 index 00000000..154f56f8 --- /dev/null +++ b/pkg/transformers/shared/constants/external.go @@ -0,0 +1,78 @@ +package constants + +import ( + "fmt" + + "github.com/spf13/viper" +) + +var initialized = false + +func initConfig() { + if initialized { + return + } + + if err := viper.ReadInConfig(); err == nil { + fmt.Printf("Using config file: %s\n\n", viper.ConfigFileUsed()) + } else { + panic(fmt.Sprintf("Could not find environment file: %v", err)) + } + initialized = true +} + +func getEnvironmentString(key string) string { + initConfig() + value := viper.GetString(key) + if value == "" { + panic(fmt.Sprintf("No environment configuration variable set for key: \"%v\"", key)) + } + return value +} + +func getEnvironmentInt64(key string) int64 { + initConfig() + value := viper.GetInt64(key) + if value == -1 { + panic(fmt.Sprintf("No environment configuration variable set for key: \"%v\"", key)) + } + return value +} + +// Getters for contract addresses from environment files +func CatContractAddress() string { return getEnvironmentString("contract.address.cat") } +func DripContractAddress() string { return getEnvironmentString("contract.address.drip") } +func FlapperContractAddress() string { return getEnvironmentString("contract.address.mcd_flap") } +func FlipperContractAddress() string { return getEnvironmentString("contract.address.eth_flip") } +func FlopperContractAddress() string { return getEnvironmentString("contract.address.mcd_flop") } +func PepContractAddress() string { return getEnvironmentString("contract.address.pep") } +func PipContractAddress() string { return getEnvironmentString("contract.address.pip") } +func PitContractAddress() string { return getEnvironmentString("contract.address.pit") } +func RepContractAddress() string { return getEnvironmentString("contract.address.rep") } +func VatContractAddress() string { return getEnvironmentString("contract.address.vat") } +func VowContractAddress() string { return getEnvironmentString("contract.address.vow") } + +func CatABI() string { return getEnvironmentString("contract.abi.cat") } +func DripABI() string { return getEnvironmentString("contract.abi.drip") } +func FlapperABI() string { return getEnvironmentString("contract.abi.mcd_flap") } +func FlipperABI() string { return getEnvironmentString("contract.abi.eth_flip") } +func FlopperABI() string { return getEnvironmentString("contract.abi.mcd_flop") } +func MedianizerABI() string { return getEnvironmentString("contract.abi.medianizer") } +func PitABI() string { return getEnvironmentString("contract.abi.pit") } +func VatABI() string { return getEnvironmentString("contract.abi.vat") } +func VowABI() string { return getEnvironmentString("contract.abi.vow") } + +func CatDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.cat") } +func DripDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.drip") } +func FlapperDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.mcd_flap") } +func FlipperDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.eth_flip") } +func FlopperDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.mcd_flop") } +func PepDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.pep") } +func PipDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.pip") } +func PitDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.pit") } +func RepDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.rep") } +func VatDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.vat") } +func VowDeploymentBlock() int64 { return getEnvironmentInt64("contract.deployment-block.vow") } +func MedianizerDeploymentBlock() int64 { + return getEnvironmentInt64("contract.deployment-block.medianizer") +} diff --git a/pkg/transformers/shared/constants/label.go b/pkg/transformers/shared/constants/label.go index 791d817a..ffee43eb 100644 --- a/pkg/transformers/shared/constants/label.go +++ b/pkg/transformers/shared/constants/label.go @@ -1,6 +1,6 @@ package constants -var ( +const ( BiteLabel = "bite" CatFileChopLumpLabel = "catFileChopLump" CatFileFlipLabel = "catFileFlip" diff --git a/pkg/transformers/shared/constants/method.go b/pkg/transformers/shared/constants/method.go index c6524b37..b6d658cf 100644 --- a/pkg/transformers/shared/constants/method.go +++ b/pkg/transformers/shared/constants/method.go @@ -1,33 +1,31 @@ package constants -var ( - //TODO: get cat, pit, and drip file method signatures directly from the ABI - biteMethod = GetSolidityMethodSignature(CatABI, "Bite") - catFileChopLumpMethod = "file(bytes32,bytes32,uint256)" - catFileFlipMethod = GetSolidityMethodSignature(CatABI, "file") - catFilePitVowMethod = "file(bytes32,address)" - dealMethod = GetSolidityMethodSignature(FlipperABI, "deal") - dentMethod = GetSolidityMethodSignature(FlipperABI, "dent") - dripDripMethod = GetSolidityMethodSignature(DripABI, "drip") - dripFileIlkMethod = "file(bytes32,bytes32,uint256)" - dripFileRepoMethod = GetSolidityMethodSignature(DripABI, "file") - dripFileVowMethod = "file(bytes32,bytes32)" - flapKickMethod = GetSolidityMethodSignature(FlapperABI, "Kick") - flipKickMethod = GetSolidityMethodSignature(FlipperABI, "Kick") - flopKickMethod = GetSolidityMethodSignature(FlopperABI, "Kick") - frobMethod = GetSolidityMethodSignature(PitABI, "Frob") - logValueMethod = GetSolidityMethodSignature(MedianizerABI, "LogValue") - pitFileDebtCeilingMethod = "file(bytes32,uint256)" - pitFileIlkMethod = "file(bytes32,bytes32,uint256)" - tendMethod = GetSolidityMethodSignature(FlipperABI, "tend") - vatFluxMethod = GetSolidityMethodSignature(VatABI, "flux") - vatFoldMethod = GetSolidityMethodSignature(VatABI, "fold") - vatGrabMethod = GetSolidityMethodSignature(VatABI, "grab") - vatHealMethod = GetSolidityMethodSignature(VatABI, "heal") - vatInitMethod = GetSolidityMethodSignature(VatABI, "init") - vatMoveMethod = GetSolidityMethodSignature(VatABI, "move") - vatSlipMethod = GetSolidityMethodSignature(VatABI, "slip") - vatTollMethod = GetSolidityMethodSignature(VatABI, "toll") - vatTuneMethod = GetSolidityMethodSignature(VatABI, "tune") - vowFlogMethod = GetSolidityMethodSignature(VowABI, "flog") -) +//TODO: get cat, pit, and drip file method signatures directly from the ABI +func biteMethod() string { return GetSolidityMethodSignature(CatABI(), "Bite") } +func catFileChopLumpMethod() string { return "file(bytes32,bytes32,uint256)" } +func catFileFlipMethod() string { return GetSolidityMethodSignature(CatABI(), "file") } +func catFilePitVowMethod() string { return "file(bytes32,address)" } +func dealMethod() string { return GetSolidityMethodSignature(FlipperABI(), "deal") } +func dentMethod() string { return GetSolidityMethodSignature(FlipperABI(), "dent") } +func dripDripMethod() string { return GetSolidityMethodSignature(DripABI(), "drip") } +func dripFileIlkMethod() string { return "file(bytes32,bytes32,uint256)" } +func dripFileRepoMethod() string { return GetSolidityMethodSignature(DripABI(), "file") } +func dripFileVowMethod() string { return "file(bytes32,bytes32)" } +func flapKickMethod() string { return GetSolidityMethodSignature(FlapperABI(), "Kick") } +func flipKickMethod() string { return GetSolidityMethodSignature(FlipperABI(), "Kick") } +func flopKickMethod() string { return GetSolidityMethodSignature(FlopperABI(), "Kick") } +func frobMethod() string { return GetSolidityMethodSignature(PitABI(), "Frob") } +func logValueMethod() string { return GetSolidityMethodSignature(MedianizerABI(), "LogValue") } +func pitFileDebtCeilingMethod() string { return "file(bytes32,uint256)" } +func pitFileIlkMethod() string { return "file(bytes32,bytes32,uint256)" } +func tendMethod() string { return GetSolidityMethodSignature(FlipperABI(), "tend") } +func vatFluxMethod() string { return GetSolidityMethodSignature(VatABI(), "flux") } +func vatFoldMethod() string { return GetSolidityMethodSignature(VatABI(), "fold") } +func vatGrabMethod() string { return GetSolidityMethodSignature(VatABI(), "grab") } +func vatHealMethod() string { return GetSolidityMethodSignature(VatABI(), "heal") } +func vatInitMethod() string { return GetSolidityMethodSignature(VatABI(), "init") } +func vatMoveMethod() string { return GetSolidityMethodSignature(VatABI(), "move") } +func vatSlipMethod() string { return GetSolidityMethodSignature(VatABI(), "slip") } +func vatTollMethod() string { return GetSolidityMethodSignature(VatABI(), "toll") } +func vatTuneMethod() string { return GetSolidityMethodSignature(VatABI(), "tune") } +func vowFlogMethod() string { return GetSolidityMethodSignature(VowABI(), "flog") } diff --git a/pkg/transformers/shared/constants/signature.go b/pkg/transformers/shared/constants/signature.go index 5fb4bc97..baa10d5f 100644 --- a/pkg/transformers/shared/constants/signature.go +++ b/pkg/transformers/shared/constants/signature.go @@ -1,32 +1,30 @@ package constants -var ( - BiteSignature = GetEventSignature(biteMethod) - CatFileChopLumpSignature = GetLogNoteSignature(catFileChopLumpMethod) - CatFileFlipSignature = GetLogNoteSignature(catFileFlipMethod) - CatFilePitVowSignature = GetLogNoteSignature(catFilePitVowMethod) - DealSignature = GetLogNoteSignature(dealMethod) - DentFunctionSignature = GetLogNoteSignature(dentMethod) - DripDripSignature = GetLogNoteSignature(dripDripMethod) - DripFileIlkSignature = GetLogNoteSignature(dripFileIlkMethod) - DripFileRepoSignature = GetLogNoteSignature(dripFileRepoMethod) - DripFileVowSignature = GetLogNoteSignature(dripFileVowMethod) - FlapKickSignature = GetEventSignature(flapKickMethod) - FlipKickSignature = GetEventSignature(flipKickMethod) - FlopKickSignature = GetEventSignature(flopKickMethod) - FrobSignature = GetEventSignature(frobMethod) - LogValueSignature = GetEventSignature(logValueMethod) - PitFileDebtCeilingSignature = GetLogNoteSignature(pitFileDebtCeilingMethod) - PitFileIlkSignature = GetLogNoteSignature(pitFileIlkMethod) - TendFunctionSignature = GetLogNoteSignature(tendMethod) - VatFluxSignature = GetLogNoteSignature(vatFluxMethod) - VatFoldSignature = GetLogNoteSignature(vatFoldMethod) - VatGrabSignature = GetLogNoteSignature(vatGrabMethod) - VatHealSignature = GetLogNoteSignature(vatHealMethod) - VatInitSignature = GetLogNoteSignature(vatInitMethod) - VatMoveSignature = GetLogNoteSignature(vatMoveMethod) - VatSlipSignature = GetLogNoteSignature(vatSlipMethod) - VatTollSignature = GetLogNoteSignature(vatTollMethod) - VatTuneSignature = GetLogNoteSignature(vatTuneMethod) - VowFlogSignature = GetLogNoteSignature(vowFlogMethod) -) +func GetBiteSignature() string { return GetEventSignature(biteMethod()) } +func GetCatFileChopLumpSignature() string { return GetLogNoteSignature(catFileChopLumpMethod()) } +func GetCatFileFlipSignature() string { return GetLogNoteSignature(catFileFlipMethod()) } +func GetCatFilePitVowSignature() string { return GetLogNoteSignature(catFilePitVowMethod()) } +func GetDealSignature() string { return GetLogNoteSignature(dealMethod()) } +func GetDentFunctionSignature() string { return GetLogNoteSignature(dentMethod()) } +func GetDripDripSignature() string { return GetLogNoteSignature(dripDripMethod()) } +func GetDripFileIlkSignature() string { return GetLogNoteSignature(dripFileIlkMethod()) } +func GetDripFileRepoSignature() string { return GetLogNoteSignature(dripFileRepoMethod()) } +func GetDripFileVowSignature() string { return GetLogNoteSignature(dripFileVowMethod()) } +func GetFlapKickSignature() string { return GetEventSignature(flapKickMethod()) } +func GetFlipKickSignature() string { return GetEventSignature(flipKickMethod()) } +func GetFlopKickSignature() string { return GetEventSignature(flopKickMethod()) } +func GetFrobSignature() string { return GetEventSignature(frobMethod()) } +func GetLogValueSignature() string { return GetEventSignature(logValueMethod()) } +func GetPitFileDebtCeilingSignature() string { return GetLogNoteSignature(pitFileDebtCeilingMethod()) } +func GetPitFileIlkSignature() string { return GetLogNoteSignature(pitFileIlkMethod()) } +func GetTendFunctionSignature() string { return GetLogNoteSignature(tendMethod()) } +func GetVatFluxSignature() string { return GetLogNoteSignature(vatFluxMethod()) } +func GetVatFoldSignature() string { return GetLogNoteSignature(vatFoldMethod()) } +func GetVatGrabSignature() string { return GetLogNoteSignature(vatGrabMethod()) } +func GetVatHealSignature() string { return GetLogNoteSignature(vatHealMethod()) } +func GetVatInitSignature() string { return GetLogNoteSignature(vatInitMethod()) } +func GetVatMoveSignature() string { return GetLogNoteSignature(vatMoveMethod()) } +func GetVatSlipSignature() string { return GetLogNoteSignature(vatSlipMethod()) } +func GetVatTollSignature() string { return GetLogNoteSignature(vatTollMethod()) } +func GetVatTuneSignature() string { return GetLogNoteSignature(vatTuneMethod()) } +func GetVowFlogSignature() string { return GetLogNoteSignature(vowFlogMethod()) } diff --git a/pkg/transformers/shared/utilities.go b/pkg/transformers/shared/utilities.go index 073f8783..fadc865f 100644 --- a/pkg/transformers/shared/utilities.go +++ b/pkg/transformers/shared/utilities.go @@ -78,3 +78,16 @@ func convert(conversion string, value string, precision int) string { } return result.Text('f', precision) } + +func MinInt64(ints []int64) (min int64) { + if len(ints) == 0 { + return 0 + } + min = ints[0] + for _, i := range ints { + if i < min { + min = i + } + } + return +} diff --git a/pkg/transformers/tend/config.go b/pkg/transformers/tend/config.go index eee96d37..39b049d7 100644 --- a/pkg/transformers/tend/config.go +++ b/pkg/transformers/tend/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var TendConfig = shared.TransformerConfig{ - TransformerName: constants.TendLabel, - ContractAddresses: []string{constants.FlapperContractAddress, constants.FlipperContractAddress}, - ContractAbi: constants.FlipperABI, - Topic: constants.TendFunctionSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetTendConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.TendLabel, + ContractAddresses: []string{constants.FlapperContractAddress(), constants.FlipperContractAddress()}, + ContractAbi: constants.FlipperABI(), + Topic: constants.GetTendFunctionSignature(), + StartingBlockNumber: shared.MinInt64([]int64{constants.FlapperDeploymentBlock(), constants.FlipperDeploymentBlock()}), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/test_data/abi.go b/pkg/transformers/test_data/abi.go new file mode 100644 index 00000000..5bc04c28 --- /dev/null +++ b/pkg/transformers/test_data/abi.go @@ -0,0 +1,14 @@ +package test_data + +const ( + KovanCatABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x626cb3c5"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"flips","outputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"},{"name":"ink","type":"uint256"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x70d9235a"},{"constant":true,"inputs":[],"name":"nflip","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x76181a51"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"flip","type":"address"},{"name":"chop","type":"uint256"},{"name":"lump","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[],"name":"pit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf03c7c6e"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"tab","type":"uint256"},{"indexed":false,"name":"flip","type":"uint256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Bite","type":"event","signature":"0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xebecb39d"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"}],"name":"bite","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x72f7b593"},{"constant":false,"inputs":[{"name":"n","type":"uint256"},{"name":"wad","type":"uint256"}],"name":"flip","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6f95917"}]` + KovanDripABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"repo","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x56ff3122"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"},{"name":"rho","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"drip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x44e2a5a8"}]` + KovanFlapperABI = `[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"gal","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]` + KovanFlipperABI = `[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4423c5f1"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4e8b1dd5"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7bd2bea7"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7d780d82"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfc4af55"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfdd3302"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf4b9fa75"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"tab","type":"uint256"}],"name":"Kick","type":"event","signature":"0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xeae19d9e"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"tick","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xfc7b6aee"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x4b43ed12"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5ff3a382"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xc959c42b"}]` + KovanFlopperABI = `[{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"vow","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]` + KovanMedianizerABI = `[{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"bytes32"}],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"compute","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"indexes","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"next","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"read","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"peek","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes12"}],"name":"values","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"min_","type":"uint96"}],"name":"setMin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"void","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"},{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"next_","type":"bytes12"}],"name":"setNext","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"min","outputs":[{"name":"","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"val","type":"bytes32"}],"name":"LogValue","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]]` + // TODO: replace with updated ABI when contract is deployed (with no pit file stability fee method + modified Frob event) + KovanPitABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[],"name":"drip","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x9f678cca"},{"constant":true,"inputs":[],"name":"Line","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbabe8a3f"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"spot","type":"uint256"},{"name":"line","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"dink","type":"int256"},{"indexed":false,"name":"dart","type":"int256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Frob","type":"event","signature":"0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"frob","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5a984ded"}]` + KovanVatABI = `[{"constant":true,"inputs":[],"name":"debt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x0dca59c1"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"urns","outputs":[{"name":"ink","type":"uint256"},{"name":"art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x26e27482"},{"constant":true,"inputs":[],"name":"vice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x2d61a355"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xa60f1d3e"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"gem","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc0912683"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"take","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"Ink","type":"uint256"},{"name":"Art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"dai","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf53e4e69"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":true,"name":"too","type":"bytes32"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"Note","type":"event","signature":"0x8c2dbbc2b33ffaa77c104b777e574a8a4ff79829dfee8b66f4dc63e3f8067152"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3b663195"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"guy","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"slip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x42066cbb"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"flux","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa6e41821"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x78f19470"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"tune","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5dd6471a"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"grab","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3690ae4c"},{"constant":false,"inputs":[{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x990a5f63"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"rate","type":"int256"}],"name":"fold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6a6a64d"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"take","type":"int256"}],"name":"toll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x09b7a0b5"}]` + KovanVowABI = `[{"constant":true,"inputs":[],"name":"Awe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Joy","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"flap","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"hump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"kiss","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Ash","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"era","type":"uint48"}],"name":"flog","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Woe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wait","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"bump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tab","type":"uint256"}],"name":"fess","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"row","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint48"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"flop","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"addr","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]` +) diff --git a/pkg/transformers/test_data/addresses.go b/pkg/transformers/test_data/addresses.go new file mode 100644 index 00000000..67c8e582 --- /dev/null +++ b/pkg/transformers/test_data/addresses.go @@ -0,0 +1,15 @@ +package test_data + +const ( + KovanCatContractAddress = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0" + KovanDripContractAddress = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d" + KovanFlapperContractAddress = "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132" + KovanFlipperContractAddress = "0x32D496Ad866D110060866B7125981C73642cc509" + KovanFlopperContractAddress = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa" + KovanPepContractAddress = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975" + KovanPipContractAddress = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc" + KovanPitContractAddress = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e" + KovanRepContractAddress = "0xf88bBDc1E2718F8857F30A180076ec38d53cf296" + KovanVatContractAddress = "0xcd726790550afcd77e9a7a47e86a3f9010af126b" + KovanVowContractAddress = "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1" +) diff --git a/pkg/transformers/test_data/bite.go b/pkg/transformers/test_data/bite.go index f82b2456..670b0ad5 100644 --- a/pkg/transformers/test_data/bite.go +++ b/pkg/transformers/test_data/bite.go @@ -21,11 +21,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/bite" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "math/big" ) -var ( +const ( TemporaryBiteBlockNumber = int64(26) TemporaryBiteData = "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005" TemporaryBiteTransaction = "0x5c698f13940a2153440c6d19660878bc90219d9298fdcf37365aa8d88d40fc42" @@ -45,7 +44,7 @@ var ( ) var EthBiteLog = types.Log{ - Address: common.HexToAddress(constants.CatContractAddress), + Address: common.HexToAddress("0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0"), Topics: []common.Hash{ common.HexToHash("0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"), common.HexToHash("0x4554480000000000000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/cat_file.go b/pkg/transformers/test_data/cat_file.go index 4c501647..8cd5c556 100644 --- a/pkg/transformers/test_data/cat_file.go +++ b/pkg/transformers/test_data/cat_file.go @@ -23,11 +23,10 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/cat_file/chop_lump" "github.com/vulcanize/vulcanizedb/pkg/transformers/cat_file/flip" "github.com/vulcanize/vulcanizedb/pkg/transformers/cat_file/pit_vow" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) var EthCatFileChopLog = types.Log{ - Address: common.HexToAddress(constants.CatContractAddress), + Address: common.HexToAddress(KovanCatContractAddress), Topics: []common.Hash{ common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -53,7 +52,7 @@ var CatFileChopModel = chop_lump.CatFileChopLumpModel{ } var EthCatFileLumpLog = types.Log{ - Address: common.HexToAddress(constants.CatContractAddress), + Address: common.HexToAddress(KovanCatContractAddress), Topics: []common.Hash{ common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -79,7 +78,7 @@ var CatFileLumpModel = chop_lump.CatFileChopLumpModel{ } var EthCatFileFlipLog = types.Log{ - Address: common.HexToAddress(constants.CatContractAddress), + Address: common.HexToAddress(KovanCatContractAddress), Topics: []common.Hash{ common.HexToHash("0xebecb39d00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -106,7 +105,7 @@ var CatFileFlipModel = flip.CatFileFlipModel{ } var EthCatFilePitVowLog = types.Log{ - Address: common.HexToAddress(constants.CatContractAddress), + Address: common.HexToAddress(KovanCatContractAddress), Topics: []common.Hash{ common.HexToHash("0xd4e8be8300000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), diff --git a/pkg/transformers/test_data/deal.go b/pkg/transformers/test_data/deal.go index 9e90f67e..65b8dfd0 100644 --- a/pkg/transformers/test_data/deal.go +++ b/pkg/transformers/test_data/deal.go @@ -21,11 +21,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/deal" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) var DealLogNote = types.Log{ - Address: common.HexToAddress(constants.FlipperContractAddress), + Address: common.HexToAddress(KovanFlipperContractAddress), Topics: []common.Hash{ common.HexToHash("0xc959c42b00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -44,7 +43,7 @@ var dealRawJson, _ = json.Marshal(DealLogNote) var DealModel = deal.DealModel{ BidId: "123", - ContractAddress: constants.FlipperContractAddress, + ContractAddress: KovanFlipperContractAddress, LogIndex: DealLogNote.Index, TransactionIndex: DealLogNote.TxIndex, Raw: dealRawJson, diff --git a/pkg/transformers/test_data/dent.go b/pkg/transformers/test_data/dent.go index 94e2a18e..8365f2dc 100644 --- a/pkg/transformers/test_data/dent.go +++ b/pkg/transformers/test_data/dent.go @@ -21,7 +21,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/dent" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "strconv" ) @@ -36,7 +35,7 @@ var ( ) var DentLog = types.Log{ - Address: common.HexToAddress(constants.FlipperContractAddress), + Address: common.HexToAddress(KovanFlipperContractAddress), Topics: []common.Hash{ common.HexToHash("0x5ff3a38200000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), diff --git a/pkg/transformers/test_data/drip_drip.go b/pkg/transformers/test_data/drip_drip.go index 147d1056..ef60b4d5 100644 --- a/pkg/transformers/test_data/drip_drip.go +++ b/pkg/transformers/test_data/drip_drip.go @@ -21,11 +21,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_drip" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) var EthDripDripLog = types.Log{ - Address: common.HexToAddress(constants.DripContractAddress), + Address: common.HexToAddress(KovanDripContractAddress), Topics: []common.Hash{ common.HexToHash("0x44e2a5a800000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), diff --git a/pkg/transformers/test_data/drip_file.go b/pkg/transformers/test_data/drip_file.go index 38de451b..37bbc88f 100644 --- a/pkg/transformers/test_data/drip_file.go +++ b/pkg/transformers/test_data/drip_file.go @@ -23,12 +23,11 @@ import ( ilk2 "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/ilk" "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/repo" "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/vow" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "math/big" ) var EthDripFileIlkLog = types.Log{ - Address: common.HexToAddress(constants.DripContractAddress), + Address: common.HexToAddress(KovanDripContractAddress), Topics: []common.Hash{ common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -55,7 +54,7 @@ var DripFileIlkModel = ilk2.DripFileIlkModel{ } var EthDripFileRepoLog = types.Log{ - Address: common.HexToAddress(constants.DripContractAddress), + Address: common.HexToAddress(KovanDripContractAddress), Topics: []common.Hash{ common.HexToHash("0x29ae811400000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -81,7 +80,7 @@ var DripFileRepoModel = repo.DripFileRepoModel{ } var EthDripFileVowLog = types.Log{ - Address: common.HexToAddress(constants.DripContractAddress), + Address: common.HexToAddress(KovanDripContractAddress), Topics: []common.Hash{ common.HexToHash("0xe9b674b900000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), diff --git a/pkg/transformers/test_data/flap_kick.go b/pkg/transformers/test_data/flap_kick.go index d7384adf..d8d87201 100644 --- a/pkg/transformers/test_data/flap_kick.go +++ b/pkg/transformers/test_data/flap_kick.go @@ -7,13 +7,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/flap_kick" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "math/big" "time" ) var EthFlapKickLog = types.Log{ - Address: common.HexToAddress(constants.FlapperContractAddress), + Address: common.HexToAddress(KovanFlapperContractAddress), Topics: []common.Hash{ common.HexToHash("0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e"), common.HexToHash("0x00000000000000000000000000000000000000000000000000000000069f6bc7"), diff --git a/pkg/transformers/test_data/flip_kick.go b/pkg/transformers/test_data/flip_kick.go index 79183995..83498a1d 100644 --- a/pkg/transformers/test_data/flip_kick.go +++ b/pkg/transformers/test_data/flip_kick.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/transformers/flip_kick" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) var ( @@ -51,9 +50,9 @@ var ( ) var EthFlipKickLog = types.Log{ - Address: common.HexToAddress(constants.FlipperContractAddress), + Address: common.HexToAddress(KovanFlipperContractAddress), Topics: []common.Hash{ - common.HexToHash(constants.FlipKickSignature), + common.HexToHash("0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"), common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000001"), common.HexToHash("0x7340e006f4135ba6970d43bf43d88dcad4e7a8ca000000000000000000000000"), }, diff --git a/pkg/transformers/test_data/flop_kick.go b/pkg/transformers/test_data/flop_kick.go index 452d0ec2..870319ac 100644 --- a/pkg/transformers/test_data/flop_kick.go +++ b/pkg/transformers/test_data/flop_kick.go @@ -21,7 +21,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/flop_kick" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "math/big" "strconv" "time" @@ -29,7 +28,7 @@ import ( var ( FlopKickLog = types.Log{ - Address: common.HexToAddress(constants.FlopperContractAddress), + Address: common.HexToAddress(KovanFlopperContractAddress), Topics: []common.Hash{ common.HexToHash("0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e"), common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000005"), diff --git a/pkg/transformers/test_data/frob.go b/pkg/transformers/test_data/frob.go index 4f5faf3d..cdaf6649 100644 --- a/pkg/transformers/test_data/frob.go +++ b/pkg/transformers/test_data/frob.go @@ -21,7 +21,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/frob" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "math/big" ) @@ -45,7 +44,7 @@ var ( ) var EthFrobLog = types.Log{ - Address: common.HexToAddress(constants.PitContractAddress), + Address: common.HexToAddress(KovanPitContractAddress), Topics: []common.Hash{ common.HexToHash("0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"), common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/pit_file.go b/pkg/transformers/test_data/pit_file.go index e1d53526..3d8b1637 100644 --- a/pkg/transformers/test_data/pit_file.go +++ b/pkg/transformers/test_data/pit_file.go @@ -26,11 +26,10 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/debt_ceiling" ilk2 "github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/ilk" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) var EthPitFileDebtCeilingLog = types.Log{ - Address: common.HexToAddress(constants.PitContractAddress), + Address: common.HexToAddress(KovanPitContractAddress), Topics: []common.Hash{ common.HexToHash("0x29ae811400000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -56,7 +55,7 @@ var PitFileDebtCeilingModel = debt_ceiling.PitFileDebtCeilingModel{ } var EthPitFileIlkLineLog = types.Log{ - Address: common.HexToAddress(constants.PitContractAddress), + Address: common.HexToAddress(KovanPitContractAddress), Topics: []common.Hash{ common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), @@ -83,7 +82,7 @@ var PitFileIlkLineModel = ilk2.PitFileIlkModel{ } var EthPitFileIlkSpotLog = types.Log{ - Address: common.HexToAddress(constants.PitContractAddress), + Address: common.HexToAddress(KovanPitContractAddress), Topics: []common.Hash{ common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"), diff --git a/pkg/transformers/test_data/price_feed.go b/pkg/transformers/test_data/price_feed.go index cab4dc5d..1be5b4e6 100644 --- a/pkg/transformers/test_data/price_feed.go +++ b/pkg/transformers/test_data/price_feed.go @@ -20,7 +20,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" "github.com/vulcanize/vulcanizedb/pkg/transformers/price_feeds" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) var ( @@ -32,7 +31,7 @@ var ( // https://etherscan.io/tx/0xa51a50a2adbfba4e2ab3d72dfd67a21c769f1bc8d2b180663a15500a56cde58f var EthPriceFeedLog = types.Log{ Address: medianizerAddress, - Topics: []common.Hash{common.HexToHash(constants.LogValueSignature)}, + Topics: []common.Hash{common.HexToHash("0x296ba4ca62c6c21c95e828080cb8aec7481b71390585605300a8a76f9e95b527")}, Data: common.FromHex("00000000000000000000000000000000000000000000001486f658319fb0c100"), BlockNumber: blockNumber, TxHash: common.HexToHash("0xa51a50a2adbfba4e2ab3d72dfd67a21c769f1bc8d2b180663a15500a56cde58f"), diff --git a/pkg/transformers/test_data/signatures.go b/pkg/transformers/test_data/signatures.go new file mode 100644 index 00000000..ffa60c2d --- /dev/null +++ b/pkg/transformers/test_data/signatures.go @@ -0,0 +1,32 @@ +package test_data + +const ( + KovanVatSlipSignature = "0x42066cbb00000000000000000000000000000000000000000000000000000000" + KovanVatTuneSignature = "0x5dd6471a00000000000000000000000000000000000000000000000000000000" + KovanBiteSignature = "0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8" + KovanCatFileFlipSignature = "0xebecb39d00000000000000000000000000000000000000000000000000000000" + KovanDripFileRepoSignature = "0x29ae811400000000000000000000000000000000000000000000000000000000" + KovanPitFileDebtCeilingSignature = "0x29ae811400000000000000000000000000000000000000000000000000000000" + KovanDentFunctionSignature = "0x5ff3a38200000000000000000000000000000000000000000000000000000000" + KovanFlopKickSignature = "0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e" + KovanTendFunctionSignature = "0x4b43ed1200000000000000000000000000000000000000000000000000000000" + KovanVatGrabSignature = "0x3690ae4c00000000000000000000000000000000000000000000000000000000" + KovanPitFileIlkSignature = "0x1a0b287e00000000000000000000000000000000000000000000000000000000" + KovanVatFluxSignature = "0xa6e4182100000000000000000000000000000000000000000000000000000000" + KovanVatMoveSignature = "0x78f1947000000000000000000000000000000000000000000000000000000000" + KovanDripFileIlkSignature = "0x1a0b287e00000000000000000000000000000000000000000000000000000000" + KovanFlapKickSignature = "0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e" + KovanDealSignature = "0xc959c42b00000000000000000000000000000000000000000000000000000000" + KovanVatFoldSignature = "0xe6a6a64d00000000000000000000000000000000000000000000000000000000" + KovanVatHealSignature = "0x990a5f6300000000000000000000000000000000000000000000000000000000" + KovanCatFileChopLumpSignature = "0x1a0b287e00000000000000000000000000000000000000000000000000000000" + KovanFlipKickSignature = "0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e" + KovanVatInitSignature = "0x3b66319500000000000000000000000000000000000000000000000000000000" + KovanCatFilePitVowSignature = "0xd4e8be8300000000000000000000000000000000000000000000000000000000" + KovanDripDripSignature = "0x44e2a5a800000000000000000000000000000000000000000000000000000000" + KovanDripFileVowSignature = "0xe9b674b900000000000000000000000000000000000000000000000000000000" + KovanFrobSignature = "0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b" + KovanLogValueSignature = "0x296ba4ca62c6c21c95e828080cb8aec7481b71390585605300a8a76f9e95b527" + KovanVatTollSignature = "0x09b7a0b500000000000000000000000000000000000000000000000000000000" + KovanVowFlogSignature = "0x35aee16f00000000000000000000000000000000000000000000000000000000" +) diff --git a/pkg/transformers/test_data/tend.go b/pkg/transformers/test_data/tend.go index d8e2bc62..5e3a0c9c 100644 --- a/pkg/transformers/test_data/tend.go +++ b/pkg/transformers/test_data/tend.go @@ -23,7 +23,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/tend" ) @@ -38,7 +37,7 @@ var ( ) var TendLogNote = types.Log{ - Address: common.HexToAddress(constants.FlipperContractAddress), + Address: common.HexToAddress(KovanFlipperContractAddress), Topics: []common.Hash{ common.HexToHash("0x4b43ed1200000000000000000000000000000000000000000000000000000000"), //abbreviated tend function signature common.HexToHash("0x0000000000000000000000007d7bee5fcfd8028cf7b00876c5b1421c800561a6"), //msg caller address diff --git a/pkg/transformers/test_data/vat_flux.go b/pkg/transformers/test_data/vat_flux.go index b311ac74..4b9e6cde 100644 --- a/pkg/transformers/test_data/vat_flux.go +++ b/pkg/transformers/test_data/vat_flux.go @@ -22,12 +22,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_flux" ) var VatFluxLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0xa6e4182100000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x5245500000000000000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vat_fold.go b/pkg/transformers/test_data/vat_fold.go index dd15fd74..73045935 100644 --- a/pkg/transformers/test_data/vat_fold.go +++ b/pkg/transformers/test_data/vat_fold.go @@ -22,12 +22,11 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_fold" ) var EthVatFoldLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0xe6a6a64d00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x5245500000000000000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vat_grab.go b/pkg/transformers/test_data/vat_grab.go index 4c78a113..f99adf87 100644 --- a/pkg/transformers/test_data/vat_grab.go +++ b/pkg/transformers/test_data/vat_grab.go @@ -6,12 +6,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_grab" ) var EthVatGrabLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x3690ae4c00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x5245500000000000000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vat_heal.go b/pkg/transformers/test_data/vat_heal.go index c5350ba3..3679f6cc 100644 --- a/pkg/transformers/test_data/vat_heal.go +++ b/pkg/transformers/test_data/vat_heal.go @@ -20,12 +20,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_heal" ) var VatHealLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x990a5f6300000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x0000000000000000000000007d7bee5fcfd8028cf7b00876c5b1421c800561a6"), diff --git a/pkg/transformers/test_data/vat_init.go b/pkg/transformers/test_data/vat_init.go index f267cf12..17cfabf3 100644 --- a/pkg/transformers/test_data/vat_init.go +++ b/pkg/transformers/test_data/vat_init.go @@ -22,12 +22,11 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_init" ) var EthVatInitLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x3b66319500000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vat_move.go b/pkg/transformers/test_data/vat_move.go index 36682275..9fd48c63 100644 --- a/pkg/transformers/test_data/vat_move.go +++ b/pkg/transformers/test_data/vat_move.go @@ -22,12 +22,11 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_move" ) var EthVatMoveLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x78f1947000000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x000000000000000000000000a730d1ff8b6bc74a26d54c20a9dda539909bab0e"), diff --git a/pkg/transformers/test_data/vat_slip.go b/pkg/transformers/test_data/vat_slip.go index 0acd1771..5fac645a 100644 --- a/pkg/transformers/test_data/vat_slip.go +++ b/pkg/transformers/test_data/vat_slip.go @@ -22,12 +22,11 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_slip" ) var EthVatSlipLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x42066cbb00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vat_toll.go b/pkg/transformers/test_data/vat_toll.go index 55ca700e..b1aed7fb 100644 --- a/pkg/transformers/test_data/vat_toll.go +++ b/pkg/transformers/test_data/vat_toll.go @@ -6,13 +6,12 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_toll" "math/big" ) var EthVatTollLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x09b7a0b500000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vat_tune.go b/pkg/transformers/test_data/vat_tune.go index d2ac9ab5..596bd7aa 100644 --- a/pkg/transformers/test_data/vat_tune.go +++ b/pkg/transformers/test_data/vat_tune.go @@ -9,12 +9,11 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vat_tune" ) var EthVatTuneLog = types.Log{ - Address: common.HexToAddress(constants.VatContractAddress), + Address: common.HexToAddress(KovanVatContractAddress), Topics: []common.Hash{ common.HexToHash("0x5dd6471a00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x4554480000000000000000000000000000000000000000000000000000000000"), diff --git a/pkg/transformers/test_data/vow_flog.go b/pkg/transformers/test_data/vow_flog.go index 53309689..427abc53 100644 --- a/pkg/transformers/test_data/vow_flog.go +++ b/pkg/transformers/test_data/vow_flog.go @@ -20,12 +20,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" "github.com/vulcanize/vulcanizedb/pkg/transformers/vow_flog" ) var EthVowFlogLog = types.Log{ - Address: common.HexToAddress(constants.VowContractAddress), + Address: common.HexToAddress(KovanVowContractAddress), Topics: []common.Hash{ common.HexToHash("0x35aee16f00000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x0000000000000000000000008e84a1e068d77059cbe263c43ad0cdc130863313"), diff --git a/pkg/transformers/transformers.go b/pkg/transformers/transformers.go index 6b0b7938..48cc3962 100644 --- a/pkg/transformers/transformers.go +++ b/pkg/transformers/transformers.go @@ -48,221 +48,277 @@ import ( ) // Custom event transformers -var ( - BiteTransformer = factories.Transformer{ - Config: bite.BiteConfig, +func GetBiteTransformer() factories.Transformer { + return factories.Transformer{ + Config: bite.GetBiteConfig(), Converter: &bite.BiteConverter{}, Repository: &bite.BiteRepository{}, } +} - FlapKickTransformer = factories.Transformer{ - Config: flap_kick.FlapKickConfig, +func GetFlapKickTransformer() factories.Transformer { + return factories.Transformer{ + Config: flap_kick.GetFlapKickConfig(), Converter: &flap_kick.FlapKickConverter{}, Repository: &flap_kick.FlapKickRepository{}, } +} - FlipKickTransformer = factories.Transformer{ - Config: flip_kick.FlipKickConfig, +func GetFlipKickTransformer() factories.Transformer { + return factories.Transformer{ + Config: flip_kick.GetFlipKickConfig(), Converter: &flip_kick.FlipKickConverter{}, Repository: &flip_kick.FlipKickRepository{}, } +} - FrobTransformer = factories.Transformer{ - Config: frob.FrobConfig, +func GetFrobTransformer() factories.Transformer { + return factories.Transformer{ + Config: frob.GetFrobConfig(), Converter: &frob.FrobConverter{}, Repository: &frob.FrobRepository{}, } +} - FlopKickTransformer = factories.Transformer{ - Config: flop_kick.Config, +func GetFlopKickTransformer() factories.Transformer { + return factories.Transformer{ + Config: flop_kick.GetFlopKickConfig(), Converter: &flop_kick.FlopKickConverter{}, Repository: &flop_kick.FlopKickRepository{}, } +} - customEventTransformers = []factories.Transformer{ - BiteTransformer, - FlapKickTransformer, - FlipKickTransformer, - FrobTransformer, - FlopKickTransformer, +func getCustomEventTransformers() []factories.Transformer { + return []factories.Transformer{ + GetBiteTransformer(), + GetFlapKickTransformer(), + GetFlipKickTransformer(), + GetFrobTransformer(), + GetFlopKickTransformer(), } -) +} // LogNote transformers -var ( - CatFileChopLumpTransformer = factories.LogNoteTransformer{ - Config: chop_lump.CatFileChopLumpConfig, +func GetCatFileChopLumpTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: chop_lump.GetCatFileChopLumpConfig(), Converter: &chop_lump.CatFileChopLumpConverter{}, Repository: &chop_lump.CatFileChopLumpRepository{}, } +} - CatFileFlipTransformer = factories.LogNoteTransformer{ - Config: flip.CatFileFlipConfig, +func GetCatFileFlipTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: flip.GetCatFileFlipConfig(), Converter: &flip.CatFileFlipConverter{}, Repository: &flip.CatFileFlipRepository{}, } +} - CatFilePitVowTransformer = factories.LogNoteTransformer{ - Config: pit_vow.CatFilePitVowConfig, +func GetCatFilePitVowTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: pit_vow.GetCatFilePitVowConfig(), Converter: &pit_vow.CatFilePitVowConverter{}, Repository: &pit_vow.CatFilePitVowRepository{}, } +} - DealTransformer = factories.LogNoteTransformer{ - Config: deal.DealConfig, +func GetDealTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: deal.GetDealConfig(), Converter: &deal.DealConverter{}, Repository: &deal.DealRepository{}, } +} - DentTransformer = factories.LogNoteTransformer{ - Config: dent.DentConfig, +func GetDentTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: dent.GetDentConfig(), Converter: &dent.DentConverter{}, Repository: &dent.DentRepository{}, } +} - DripDripTransformer = factories.LogNoteTransformer{ - Config: drip_drip.DripDripConfig, +func GetDripDripTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: drip_drip.GetDripDripConfig(), Converter: &drip_drip.DripDripConverter{}, Repository: &drip_drip.DripDripRepository{}, } +} - DripFileIlkTransformer = factories.LogNoteTransformer{ - Config: ilk2.DripFileIlkConfig, +func GetDripFileIlkTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: ilk2.GetDripFileIlkConfig(), Converter: &ilk2.DripFileIlkConverter{}, Repository: &ilk2.DripFileIlkRepository{}, } +} - DripFileRepoTransformer = factories.LogNoteTransformer{ - Config: repo.DripFileRepoConfig, +func GetDripFileRepoTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: repo.GetDripFileRepoConfig(), Converter: &repo.DripFileRepoConverter{}, Repository: &repo.DripFileRepoRepository{}, } +} - DripFileVowTransfromer = factories.LogNoteTransformer{ - Config: vow.DripFileVowConfig, +func GetDripFileVowTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vow.GetDripFileVowConfig(), Converter: &vow.DripFileVowConverter{}, Repository: &vow.DripFileVowRepository{}, } +} - FlogTransformer = factories.LogNoteTransformer{ - Config: vow_flog.VowFlogConfig, +func GetFlogTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vow_flog.GetVowFlogConfig(), Converter: &vow_flog.VowFlogConverter{}, Repository: &vow_flog.VowFlogRepository{}, } +} - PitFileDebtCeilingTransformer = factories.LogNoteTransformer{ - Config: debt_ceiling.DebtCeilingFileConfig, +func GetPitFileDebtCeilingTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: debt_ceiling.GetDebtCeilingFileConfig(), Converter: &debt_ceiling.PitFileDebtCeilingConverter{}, Repository: &debt_ceiling.PitFileDebtCeilingRepository{}, } +} - PitFileIlkTransformer = factories.LogNoteTransformer{ - Config: ilk.IlkFileConfig, +func GetPitFileIlkTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: ilk.GetIlkFileConfig(), Converter: &ilk.PitFileIlkConverter{}, Repository: &ilk.PitFileIlkRepository{}, } +} - PriceFeedTransformer = factories.LogNoteTransformer{ - Config: price_feeds.PriceFeedConfig, +func GetPriceFeedTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: price_feeds.GetPriceFeedConfig(), Converter: &price_feeds.PriceFeedConverter{}, Repository: &price_feeds.PriceFeedRepository{}, } +} - TendTransformer = factories.LogNoteTransformer{ - Config: tend.TendConfig, +func GetTendTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: tend.GetTendConfig(), Converter: &tend.TendConverter{}, Repository: &tend.TendRepository{}, } +} - VatInitTransformer = factories.LogNoteTransformer{ - Config: vat_init.VatInitConfig, +func GetVatInitTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_init.GetVatInitConfig(), Converter: &vat_init.VatInitConverter{}, Repository: &vat_init.VatInitRepository{}, } +} - VatGrabTransformer = factories.LogNoteTransformer{ - Config: vat_grab.VatGrabConfig, +func GetVatGrabTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_grab.GetVatGrabConfig(), Converter: &vat_grab.VatGrabConverter{}, Repository: &vat_grab.VatGrabRepository{}, } +} - VatFoldTransformer = factories.LogNoteTransformer{ - Config: vat_fold.VatFoldConfig, +func GetVatFoldTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_fold.GetVatFoldConfig(), Converter: &vat_fold.VatFoldConverter{}, Repository: &vat_fold.VatFoldRepository{}, } +} - VatHealTransformer = factories.LogNoteTransformer{ - Config: vat_heal.VatHealConfig, +func GetVatHealTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_heal.GetVatHealConfig(), Converter: &vat_heal.VatHealConverter{}, Repository: &vat_heal.VatHealRepository{}, } +} - VatMoveTransformer = factories.LogNoteTransformer{ - Config: vat_move.VatMoveConfig, +func GetVatMoveTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_move.GetVatMoveConfig(), Converter: &vat_move.VatMoveConverter{}, Repository: &vat_move.VatMoveRepository{}, } +} - VatSlipTransformer = factories.LogNoteTransformer{ - Config: vat_slip.VatSlipConfig, +func GetVatSlipTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_slip.GetVatSlipConfig(), Converter: &vat_slip.VatSlipConverter{}, Repository: &vat_slip.VatSlipRepository{}, } +} - VatTollTransformer = factories.LogNoteTransformer{ - Config: vat_toll.VatTollConfig, +func GetVatTollTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_toll.GetVatTollConfig(), Converter: &vat_toll.VatTollConverter{}, Repository: &vat_toll.VatTollRepository{}, } +} - VatTuneTransformer = factories.LogNoteTransformer{ - Config: vat_tune.VatTuneConfig, +func GetVatTuneTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_tune.GetVatTuneConfig(), Converter: &vat_tune.VatTuneConverter{}, Repository: &vat_tune.VatTuneRepository{}, } +} - VatFluxTransformer = factories.LogNoteTransformer{ - Config: vat_flux.VatFluxConfig, +func GetVatFluxTransformer() factories.LogNoteTransformer { + return factories.LogNoteTransformer{ + Config: vat_flux.GetVatFluxConfig(), Converter: &vat_flux.VatFluxConverter{}, Repository: &vat_flux.VatFluxRepository{}, } +} - logNoteTransformers = []factories.LogNoteTransformer{ - CatFileChopLumpTransformer, - CatFileFlipTransformer, - CatFilePitVowTransformer, - DealTransformer, - DentTransformer, - DripDripTransformer, - DripFileIlkTransformer, - DripFileRepoTransformer, - DripFileVowTransfromer, - FlogTransformer, - PitFileDebtCeilingTransformer, - PitFileIlkTransformer, - PriceFeedTransformer, - TendTransformer, - VatInitTransformer, - VatGrabTransformer, - VatFoldTransformer, - VatHealTransformer, - VatMoveTransformer, - VatSlipTransformer, - VatTollTransformer, - VatTuneTransformer, - VatFluxTransformer, +func getLogNoteTransformers() []factories.LogNoteTransformer { + return []factories.LogNoteTransformer{ + GetCatFileChopLumpTransformer(), + GetCatFileFlipTransformer(), + GetCatFilePitVowTransformer(), + GetDealTransformer(), + GetDentTransformer(), + GetDripDripTransformer(), + GetDripFileIlkTransformer(), + GetDripFileRepoTransformer(), + GetDripFileVowTransformer(), + GetFlogTransformer(), + GetPitFileDebtCeilingTransformer(), + GetPitFileIlkTransformer(), + GetPriceFeedTransformer(), + GetTendTransformer(), + GetVatInitTransformer(), + GetVatGrabTransformer(), + GetVatFoldTransformer(), + GetVatHealTransformer(), + GetVatMoveTransformer(), + GetVatSlipTransformer(), + GetVatTollTransformer(), + GetVatTuneTransformer(), + GetVatFluxTransformer(), } -) +} // `TransformerInitializers` returns a list of functions, that given a db pointer // will return a `shared.Transformer` func TransformerInitializers() (initializers []shared.TransformerInitializer) { - for _, transformer := range logNoteTransformers { + for _, transformer := range getLogNoteTransformers() { initializers = append(initializers, transformer.NewLogNoteTransformer) } - for _, transformer := range customEventTransformers { + for _, transformer := range getCustomEventTransformers() { initializers = append(initializers, transformer.NewTransformer) } return diff --git a/pkg/transformers/vat_flux/config.go b/pkg/transformers/vat_flux/config.go index 2d3dfb24..e33d8d34 100644 --- a/pkg/transformers/vat_flux/config.go +++ b/pkg/transformers/vat_flux/config.go @@ -5,11 +5,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatFluxConfig = shared.TransformerConfig{ - TransformerName: constants.VatFluxLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatFluxSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatFluxConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatFluxLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatFluxSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_fold/config.go b/pkg/transformers/vat_fold/config.go index 7aeacfbd..696061ad 100644 --- a/pkg/transformers/vat_fold/config.go +++ b/pkg/transformers/vat_fold/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatFoldConfig = shared.TransformerConfig{ - TransformerName: constants.VatFoldLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatFoldSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatFoldConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatFoldLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatFoldSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_fold/converter.go b/pkg/transformers/vat_fold/converter.go index 1e13394d..6fbac2f5 100644 --- a/pkg/transformers/vat_fold/converter.go +++ b/pkg/transformers/vat_fold/converter.go @@ -21,7 +21,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/vulcanize/vulcanizedb/pkg/transformers/shared" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) type VatFoldConverter struct{} @@ -61,11 +60,5 @@ func verifyLog(log types.Log) error { if len(log.Topics) < 4 { return errors.New("log missing topics") } - - sig := log.Topics[0].String() - if sig != constants.VatFoldSignature { - return errors.New("log is not a Vat.fold event") - } - return nil } diff --git a/pkg/transformers/vat_grab/config.go b/pkg/transformers/vat_grab/config.go index c595b410..89b8b309 100644 --- a/pkg/transformers/vat_grab/config.go +++ b/pkg/transformers/vat_grab/config.go @@ -5,11 +5,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatGrabConfig = shared.TransformerConfig{ - TransformerName: constants.VatGrabLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatGrabSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatGrabConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatGrabLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatGrabSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_heal/config.go b/pkg/transformers/vat_heal/config.go index d12261af..ff40a8a1 100644 --- a/pkg/transformers/vat_heal/config.go +++ b/pkg/transformers/vat_heal/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatHealConfig = shared.TransformerConfig{ - TransformerName: constants.VatHealLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatHealSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatHealConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatHealLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatHealSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_init/config.go b/pkg/transformers/vat_init/config.go index a25cb492..16954d0a 100644 --- a/pkg/transformers/vat_init/config.go +++ b/pkg/transformers/vat_init/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatInitConfig = shared.TransformerConfig{ - TransformerName: constants.VatInitLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatInitSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatInitConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatInitLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatInitSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_move/config.go b/pkg/transformers/vat_move/config.go index 1fbcdae7..e01bbef5 100644 --- a/pkg/transformers/vat_move/config.go +++ b/pkg/transformers/vat_move/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatMoveConfig = shared.TransformerConfig{ - TransformerName: constants.VatMoveLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatMoveSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatMoveConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatMoveLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatMoveSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_slip/config.go b/pkg/transformers/vat_slip/config.go index c571ac87..db910f51 100644 --- a/pkg/transformers/vat_slip/config.go +++ b/pkg/transformers/vat_slip/config.go @@ -5,11 +5,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatSlipConfig = shared.TransformerConfig{ - TransformerName: constants.VatSlipLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatSlipSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatSlipConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatSlipLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatSlipSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_toll/config.go b/pkg/transformers/vat_toll/config.go index d7180849..0003dc2b 100644 --- a/pkg/transformers/vat_toll/config.go +++ b/pkg/transformers/vat_toll/config.go @@ -5,11 +5,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatTollConfig = shared.TransformerConfig{ - TransformerName: constants.VatTollLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatTollSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatTollConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatTollLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatTollSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vat_tune/config.go b/pkg/transformers/vat_tune/config.go index b0c1091a..1a323258 100644 --- a/pkg/transformers/vat_tune/config.go +++ b/pkg/transformers/vat_tune/config.go @@ -5,11 +5,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VatTuneConfig = shared.TransformerConfig{ - TransformerName: constants.VatTuneLabel, - ContractAddresses: []string{constants.VatContractAddress}, - ContractAbi: constants.VatABI, - Topic: constants.VatTuneSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVatTuneConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VatTuneLabel, + ContractAddresses: []string{constants.VatContractAddress()}, + ContractAbi: constants.VatABI(), + Topic: constants.GetVatTuneSignature(), + StartingBlockNumber: constants.VatDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/pkg/transformers/vow_flog/config.go b/pkg/transformers/vow_flog/config.go index 8b847705..ea66430c 100644 --- a/pkg/transformers/vow_flog/config.go +++ b/pkg/transformers/vow_flog/config.go @@ -19,11 +19,13 @@ import ( "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants" ) -var VowFlogConfig = shared.TransformerConfig{ - TransformerName: constants.VowFlogLabel, - ContractAddresses: []string{constants.VowContractAddress}, - ContractAbi: constants.VowABI, - Topic: constants.VowFlogSignature, - StartingBlockNumber: 0, - EndingBlockNumber: -1, +func GetVowFlogConfig() shared.TransformerConfig { + return shared.TransformerConfig{ + TransformerName: constants.VowFlogLabel, + ContractAddresses: []string{constants.VowContractAddress()}, + ContractAbi: constants.VowABI(), + Topic: constants.GetVowFlogSignature(), + StartingBlockNumber: constants.VowDeploymentBlock(), + EndingBlockNumber: -1, + } } diff --git a/test_config/test_config.go b/test_config/test_config.go index 2d31916b..cc9db3c1 100644 --- a/test_config/test_config.go +++ b/test_config/test_config.go @@ -1,6 +1,7 @@ package test_config import ( + "fmt" log "github.com/sirupsen/logrus" "os" @@ -68,7 +69,10 @@ func setABIPath() { } func NewTestDB(node core.Node) *postgres.DB { - db, _ := postgres.NewDB(DBConfig, node) + db, err := postgres.NewDB(DBConfig, node) + if err != nil { + panic(fmt.Sprintf("Could not create new test db: %v", err)) + } return db }