Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ token-tracker/
**/gen/**/*.go
!**/gen/gen.go
!**/gen/cmd/cmd.go
!pkg/chain/ethereum/frost/gen/abi/*.go
!pkg/chain/ethereum/frost/gen/validatorabi/*.go

# Legacy V1 contracts bindings.
# We won't generate new bindings in the docker build process, but use the existing ones.
Expand Down
2 changes: 2 additions & 0 deletions cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,5 +394,7 @@ func initDeveloperFlags(command *cobra.Command) {
initContractAddressFlag(chainEthereum.RandomBeaconContractName)
initContractAddressFlag(chainEthereum.TokenStakingContractName)
initContractAddressFlag(chainEthereum.WalletRegistryContractName)
initContractAddressFlag(chainEthereum.FrostWalletRegistryContractName)
initContractAddressFlag(chainEthereum.FrostDkgValidatorContractName)
initContractAddressFlag(chainEthereum.WalletProposalValidatorContractName)
}
2 changes: 2 additions & 0 deletions cmd/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ func buildContractAddresses(lineLength int, prefix, suffix string, ethereumConfi
chainEthereum.RandomBeaconContractName,
chainEthereum.BridgeContractName,
chainEthereum.WalletRegistryContractName,
chainEthereum.FrostWalletRegistryContractName,
chainEthereum.FrostDkgValidatorContractName,
chainEthereum.TokenStakingContractName,
chainEthereum.WalletProposalValidatorContractName,
}
Expand Down
21 changes: 21 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/keep-network/keep-core/pkg/chain/ethereum"
ethereumBeacon "github.com/keep-network/keep-core/pkg/chain/ethereum/beacon/gen"
ethereumEcdsa "github.com/keep-network/keep-core/pkg/chain/ethereum/ecdsa/gen"
ethereumFrost "github.com/keep-network/keep-core/pkg/chain/ethereum/frost/gen"
ethereumTbtc "github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen"
ethereumThreshold "github.com/keep-network/keep-core/pkg/chain/ethereum/threshold/gen"
)
Expand Down Expand Up @@ -68,6 +69,8 @@ func TestReadConfigFromFile(t *testing.T) {
expectedValue: map[string]string{
"randombeacon": "0xcf64c2a367341170cb4e09cf8c0ed137d8473ceb",
"walletregistry": "0x143ba24e66fce8bca22f7d739f9a932c519b1c76",
"frostwalletregistry": "0x0000000000000000000000000000000000000000",
"frostdkgvalidator": "0x0000000000000000000000000000000000000000",
"tokenstaking": "0xa363a197f1bbb8877f50350234e3f15fb4175457",
"bridge": "0x138D2a0c87BA9f6BE1DCc13D6224A6aCE9B6b6F0",
"maintainerproxy": "0xC6D21c2871586A2B098c0ad043fF0D47a3c7e7ae",
Expand Down Expand Up @@ -331,6 +334,8 @@ func TestReadConfig_ReadContracts(t *testing.T) {

ethereumBeacon.RandomBeaconAddress = "0xd1640b381327c2d5425d6d3d605539a3db72f857"
ethereumEcdsa.WalletRegistryAddress = "0xdb3dd6d4f43d39c996d0afeb6fbabc284f9ffb1a"
ethereumFrost.FrostWalletRegistryAddress = "0x0000000000000000000000000000000000000000"
ethereumFrost.FrostDkgValidatorAddress = "0x0000000000000000000000000000000000000000"
ethereumThreshold.TokenStakingAddress = "0xaa7b41039ea8f9ec2d89bbe96e19f97b6c267a27"
ethereumTbtc.BridgeAddress = "0x9490165195503fcf6a0fd20ac113223fefb66ed5"
ethereumTbtc.WalletProposalValidatorAddress = "0xE7d33d8AA55B73a93059a24b900366894684a497"
Expand All @@ -340,6 +345,8 @@ func TestReadConfig_ReadContracts(t *testing.T) {

expectedRandomBeaconAddress string
expectedWalletRegistryAddress string
expectedFrostWalletRegistryAddress string
expectedFrostDkgValidatorAddress string
expectedTokenStakingAddress string
expectedBridgeAddress string
expectedWalletProposalValidatorAddress string
Expand All @@ -348,6 +355,8 @@ func TestReadConfig_ReadContracts(t *testing.T) {
configFilePath: "../test/config_no_contracts.toml",
expectedRandomBeaconAddress: "0xd1640b381327c2d5425d6d3d605539a3db72f857",
expectedWalletRegistryAddress: "0xdb3dd6d4f43d39c996d0afeb6fbabc284f9ffb1a",
expectedFrostWalletRegistryAddress: "0x0000000000000000000000000000000000000000",
expectedFrostDkgValidatorAddress: "0x0000000000000000000000000000000000000000",
expectedTokenStakingAddress: "0xaa7b41039ea8f9ec2d89bbe96e19f97b6c267a27",
expectedBridgeAddress: "0x9490165195503fcf6a0fd20ac113223fefb66ed5",
expectedWalletProposalValidatorAddress: "0xE7d33d8AA55B73a93059a24b900366894684a497",
Expand All @@ -356,6 +365,8 @@ func TestReadConfig_ReadContracts(t *testing.T) {
configFilePath: "../test/config.toml",
expectedRandomBeaconAddress: "0xcf64c2a367341170cb4e09cf8c0ed137d8473ceb",
expectedWalletRegistryAddress: "0x143ba24e66fce8bca22f7d739f9a932c519b1c76",
expectedFrostWalletRegistryAddress: "0x0000000000000000000000000000000000000000",
expectedFrostDkgValidatorAddress: "0x0000000000000000000000000000000000000000",
expectedTokenStakingAddress: "0xa363a197f1bbb8877f50350234e3f15fb4175457",
expectedBridgeAddress: "0x138D2a0c87BA9f6BE1DCc13D6224A6aCE9B6b6F0",
expectedWalletProposalValidatorAddress: "0xfdc315b0e608b7cDE9166D9D69a1506779e3E0CA",
Expand All @@ -364,6 +375,8 @@ func TestReadConfig_ReadContracts(t *testing.T) {
configFilePath: "../test/config_mixed_contracts.toml",
expectedRandomBeaconAddress: "0xd1640b381327c2d5425d6d3d605539a3db72f857",
expectedWalletRegistryAddress: "0x143ba24e66fce8bca22f7d739f9a932c519b1c76",
expectedFrostWalletRegistryAddress: "0x0000000000000000000000000000000000000000",
expectedFrostDkgValidatorAddress: "0x0000000000000000000000000000000000000000",
expectedTokenStakingAddress: "0xaa7b41039ea8f9ec2d89bbe96e19f97b6c267a27",
expectedBridgeAddress: "0x9490165195503fcf6a0fd20ac113223fefb66ed5",
expectedWalletProposalValidatorAddress: "0xE7d33d8AA55B73a93059a24b900366894684a497",
Expand Down Expand Up @@ -398,6 +411,14 @@ func TestReadConfig_ReadContracts(t *testing.T) {

validate(ethereum.RandomBeaconContractName, test.expectedRandomBeaconAddress)
validate(ethereum.WalletRegistryContractName, test.expectedWalletRegistryAddress)
validate(
ethereum.FrostWalletRegistryContractName,
test.expectedFrostWalletRegistryAddress,
)
validate(
ethereum.FrostDkgValidatorContractName,
test.expectedFrostDkgValidatorAddress,
)
validate(ethereum.TokenStakingContractName, test.expectedTokenStakingAddress)
validate(ethereum.BridgeContractName, test.expectedBridgeAddress)
validate(ethereum.WalletProposalValidatorContractName, test.expectedWalletProposalValidatorAddress)
Expand Down
11 changes: 11 additions & 0 deletions config/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

ethereumBeacon "github.com/keep-network/keep-core/pkg/chain/ethereum/beacon/gen"
ethereumEcdsa "github.com/keep-network/keep-core/pkg/chain/ethereum/ecdsa/gen"
ethereumFrost "github.com/keep-network/keep-core/pkg/chain/ethereum/frost/gen"
ethereumTbtc "github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen"
ethereumThreshold "github.com/keep-network/keep-core/pkg/chain/ethereum/threshold/gen"
)
Expand Down Expand Up @@ -39,6 +40,8 @@ func initializeContractAddressesAliases() {
aliasEthereumContract(chainEthereum.RandomBeaconContractName)
aliasEthereumContract(chainEthereum.TokenStakingContractName)
aliasEthereumContract(chainEthereum.WalletRegistryContractName)
aliasEthereumContract(chainEthereum.FrostWalletRegistryContractName)
aliasEthereumContract(chainEthereum.FrostDkgValidatorContractName)
aliasEthereumContract(chainEthereum.BridgeContractName)
aliasEthereumContract(chainEthereum.MaintainerProxyContractName)
aliasEthereumContract(chainEthereum.LightRelayContractName)
Expand Down Expand Up @@ -72,6 +75,14 @@ func (c *Config) resolveContractsAddresses() {
chainEthereum.WalletRegistryContractName,
ethereumEcdsa.WalletRegistryAddress,
)
resolveContractAddress(
chainEthereum.FrostWalletRegistryContractName,
ethereumFrost.FrostWalletRegistryAddress,
)
resolveContractAddress(
chainEthereum.FrostDkgValidatorContractName,
ethereumFrost.FrostDkgValidatorAddress,
)
resolveContractAddress(
chainEthereum.BridgeContractName,
ethereumTbtc.BridgeAddress,
Expand Down
Loading
Loading