evm/traderjoe/router.go

22 lines
588 B
Go
Raw Normal View History

2021-11-19 06:25:59 +00:00
package traderjoe
import (
"git.lehouerou.net/laurent/evm"
"git.lehouerou.net/laurent/evm/avalanche"
"git.lehouerou.net/laurent/evm/traderjoe/contracts"
"github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
)
const (
RouterAddress = "0x60aE616a2155Ee3d9A68541Ba4544862310933d4"
)
func NewRouter(client *avalanche.Client) (*evm.UniswapRouter, error) {
contract, err := contracts.NewRouter(common.HexToAddress(RouterAddress), client)
if err != nil {
return nil, errors.Wrap(err, "init contract")
}
return evm.NewUniswapRouter("traderjoe", client, contract), nil
}