diff --git a/x/crosschain/types/expected_keepers.go b/x/crosschain/types/expected_keepers.go index 668cb6c8b6..ed5aacb267 100644 --- a/x/crosschain/types/expected_keepers.go +++ b/x/crosschain/types/expected_keepers.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - eth "github.com/ethereum/go-ethereum/common" ethcommon "github.com/ethereum/go-ethereum/common" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/zeta-chain/zetacore/pkg/chains" @@ -101,24 +100,24 @@ type FungibleKeeper interface { GetForeignCoinFromAsset(ctx sdk.Context, asset string, chainID int64) (fungibletypes.ForeignCoins, bool) GetGasCoinForForeignCoin(ctx sdk.Context, chainID int64) (fungibletypes.ForeignCoins, bool) GetSystemContract(ctx sdk.Context) (val fungibletypes.SystemContract, found bool) - QuerySystemContractGasCoinZRC20(ctx sdk.Context, chainID *big.Int) (eth.Address, error) - GetUniswapV2Router02Address(ctx sdk.Context) (eth.Address, error) - QueryUniswapV2RouterGetZetaAmountsIn(ctx sdk.Context, amountOut *big.Int, outZRC4 eth.Address) (*big.Int, error) - QueryUniswapV2RouterGetZRC4ToZRC4AmountsIn(ctx sdk.Context, amountOut *big.Int, inZRC4, outZRC4 eth.Address) (*big.Int, error) - QueryGasLimit(ctx sdk.Context, contract eth.Address) (*big.Int, error) - QueryProtocolFlatFee(ctx sdk.Context, contract eth.Address) (*big.Int, error) + QuerySystemContractGasCoinZRC20(ctx sdk.Context, chainID *big.Int) (ethcommon.Address, error) + GetUniswapV2Router02Address(ctx sdk.Context) (ethcommon.Address, error) + QueryUniswapV2RouterGetZetaAmountsIn(ctx sdk.Context, amountOut *big.Int, outZRC4 ethcommon.Address) (*big.Int, error) + QueryUniswapV2RouterGetZRC4ToZRC4AmountsIn(ctx sdk.Context, amountOut *big.Int, inZRC4, outZRC4 ethcommon.Address) (*big.Int, error) + QueryGasLimit(ctx sdk.Context, contract ethcommon.Address) (*big.Int, error) + QueryProtocolFlatFee(ctx sdk.Context, contract ethcommon.Address) (*big.Int, error) SetGasPrice(ctx sdk.Context, chainID *big.Int, gasPrice *big.Int) (uint64, error) - DepositCoinZeta(ctx sdk.Context, to eth.Address, amount *big.Int) error + DepositCoinZeta(ctx sdk.Context, to ethcommon.Address, amount *big.Int) error DepositZRC20( ctx sdk.Context, - contract eth.Address, - to eth.Address, + contract ethcommon.Address, + to ethcommon.Address, amount *big.Int, ) (*evmtypes.MsgEthereumTxResponse, error) ZRC20DepositAndCallContract( ctx sdk.Context, from []byte, - to eth.Address, + to ethcommon.Address, amount *big.Int, senderChainID int64, data []byte, @@ -127,27 +126,27 @@ type FungibleKeeper interface { ) (*evmtypes.MsgEthereumTxResponse, bool, error) CallUniswapV2RouterSwapExactTokensForTokens( ctx sdk.Context, - sender eth.Address, - to eth.Address, + sender ethcommon.Address, + to ethcommon.Address, amountIn *big.Int, inZRC4, - outZRC4 eth.Address, + outZRC4 ethcommon.Address, noEthereumTxEvent bool, ) (ret []*big.Int, err error) CallUniswapV2RouterSwapExactETHForToken( ctx sdk.Context, - sender eth.Address, - to eth.Address, + sender ethcommon.Address, + to ethcommon.Address, amountIn *big.Int, - outZRC4 eth.Address, + outZRC4 ethcommon.Address, noEthereumTxEvent bool, ) ([]*big.Int, error) - CallZRC20Burn(ctx sdk.Context, sender eth.Address, zrc20address eth.Address, amount *big.Int, noEthereumTxEvent bool) error + CallZRC20Burn(ctx sdk.Context, sender ethcommon.Address, zrc20address ethcommon.Address, amount *big.Int, noEthereumTxEvent bool) error CallZRC20Approve( ctx sdk.Context, - owner eth.Address, - zrc20address eth.Address, - spender eth.Address, + owner ethcommon.Address, + zrc20address ethcommon.Address, + spender ethcommon.Address, amount *big.Int, noEthereumTxEvent bool, ) error @@ -159,7 +158,7 @@ type FungibleKeeper interface { coinType coin.CoinType, erc20Contract string, gasLimit *big.Int, - ) (eth.Address, error) + ) (ethcommon.Address, error) FundGasStabilityPool(ctx sdk.Context, chainID int64, amount *big.Int) error WithdrawFromGasStabilityPool(ctx sdk.Context, chainID int64, amount *big.Int) error ZETADepositAndCallContract(ctx sdk.Context, diff --git a/x/fungible/keeper/evm.go b/x/fungible/keeper/evm.go index 40be2f8f75..04dda559e9 100644 --- a/x/fungible/keeper/evm.go +++ b/x/fungible/keeper/evm.go @@ -14,20 +14,18 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - ethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" evmtypes "github.com/evmos/ethermint/x/evm/types" tmbytes "github.com/tendermint/tendermint/libs/bytes" tmtypes "github.com/tendermint/tendermint/types" - systemcontract "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/systemcontract.sol" + "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/systemcontract.sol" "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/wzeta.sol" - connectorzevm "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zetaconnectorzevm.sol" zevmconnectercontract "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zetaconnectorzevm.sol" - zrc20 "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zrc20.sol" - uniswapv2factory "github.com/zeta-chain/protocol-contracts/pkg/uniswap/v2-core/contracts/uniswapv2factory.sol" - uniswapv2router02 "github.com/zeta-chain/protocol-contracts/pkg/uniswap/v2-periphery/contracts/uniswapv2router02.sol" + "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zrc20.sol" + "github.com/zeta-chain/protocol-contracts/pkg/uniswap/v2-core/contracts/uniswapv2factory.sol" + "github.com/zeta-chain/protocol-contracts/pkg/uniswap/v2-periphery/contracts/uniswapv2router02.sol" "github.com/zeta-chain/zetacore/pkg/chains" "github.com/zeta-chain/zetacore/pkg/coin" "github.com/zeta-chain/zetacore/server/config" @@ -183,7 +181,7 @@ func (k Keeper) DeployWZETA(ctx sdk.Context) (common.Address, error) { } func (k Keeper) DeployConnectorZEVM(ctx sdk.Context, wzeta common.Address) (common.Address, error) { - contractAddr, err := k.DeployContract(ctx, connectorzevm.ZetaConnectorZEVMMetaData, wzeta) + contractAddr, err := k.DeployContract(ctx, zevmconnectercontract.ZetaConnectorZEVMMetaData, wzeta) if err != nil { return common.Address{}, cosmoserrors.Wrapf(err, "ZetaConnectorZEVM") } @@ -315,7 +313,7 @@ func (k Keeper) DepositZRC20AndCallContract(ctx sdk.Context, func (k Keeper) CallOnReceiveZevmConnector(ctx sdk.Context, zetaTxSenderAddress []byte, sourceChainID *big.Int, - destinationAddress ethcommon.Address, + destinationAddress common.Address, zetaValue *big.Int, message []byte, internalSendHash [32]byte, @@ -360,7 +358,7 @@ func (k Keeper) CallOnReceiveZevmConnector(ctx sdk.Context, // The onRevert function will then wrap this native zeta into WZETA and call the onRevert function of the contract specified by the zetaTxSenderAddress // Note the destination address is the original destination address of the transaction and not the current destination . func (k Keeper) CallOnRevertZevmConnector(ctx sdk.Context, - zetaTxSenderAddress ethcommon.Address, + zetaTxSenderAddress common.Address, sourceChainID *big.Int, destinationAddress []byte, destinationChainID *big.Int,