31 lines
1.1 KiB
Go
31 lines
1.1 KiB
Go
package polycat
|
|
|
|
import (
|
|
"context"
|
|
|
|
"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/ethereum/go-ethereum/core/types"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
var (
|
|
FISH = common.HexToAddress("0x3a3Df212b7AA91Aa0402B9035b098891d276572B")
|
|
OLDPAW = common.HexToAddress("0x6971aca589bbd367516d70c3d210e4906b090c96")
|
|
PAW = common.HexToAddress("0xbc5b59ea1b6f8da8258615ee38d40e999ec5d74f")
|
|
PAWFISHLP = common.HexToAddress("0xc7080deb5d75d528ba36eb3bec0b4c27797752fa")
|
|
WBTCWETHLP = common.HexToAddress("0xbbbd54c1cd649288d2e584917778eeccd8d8254d")
|
|
)
|
|
|
|
func MigrateOldPawToV2(ctx context.Context, client *polygon.Client, opts ...evm.ExecutionOption) (evm.Transaction, error) {
|
|
pawv2, err := contracts.NewPawV2(PAW, client)
|
|
if err != nil {
|
|
return nil, errors.Wrap(err, "init pawv2 contract")
|
|
}
|
|
return client.Execute(ctx, func(ctx context.Context, options *evm.TransactOpts) (*types.Transaction, error) {
|
|
return pawv2.Migrate(options.TransactOpts)
|
|
}, opts...)
|
|
}
|