evm/polycat/catrouter.go
2021-11-09 09:45:18 +04:00

20 lines
577 B
Go

package polycat
import (
"git.lehouerou.net/laurent/evm"
"git.lehouerou.net/laurent/evm/polycat/contracts"
"git.lehouerou.net/laurent/evm/polygon"
"github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
)
const CatRouterAddress = "0x94930a328162957FF1dd48900aF67B5439336cBD"
func NewCatRouterService(c *polygon.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
}