evm/polycat/catrouter.go

20 lines
577 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"
2021-11-09 05:45:18 +00:00
"git.lehouerou.net/laurent/evm/polygon"
2021-11-09 05:07:42 +00:00
"github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
)
const CatRouterAddress = "0x94930a328162957FF1dd48900aF67B5439336cBD"
2021-11-09 05:45:18 +00:00
func NewCatRouterService(c *polygon.Client) (*evm.UniswapRouter, error) {
2021-11-09 05:07:42 +00:00
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
}