evm/polycat/catrouter.go

19 lines
531 B
Go
Raw Normal View History

2021-11-09 05:07:42 +00:00
package polycat
import (
"git.lehouerou.net/laurent/evm"
"git.lehouerou.net/laurent/evm/polycat/contracts"
"github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
)
const CatRouterAddress = "0x94930a328162957FF1dd48900aF67B5439336cBD"
func NewCatRouterService(c evm.Client) (*evm.UniswapRouter, error) {
contract, err := contracts.NewCatRouter(common.HexToAddress(CatRouterAddress), c)
if err != nil {
return nil, errors.Wrap(err, "init contract")
}
return evm.NewUniswapRouter("polycat", c, contract), nil
}