Skip to content

Commit 783c4f2

Browse files
committed
v3 init
1 parent e488349 commit 783c4f2

File tree

18 files changed

+49
-44
lines changed

18 files changed

+49
-44
lines changed

contracts/contracts.go

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,21 @@ import (
1010
"github.com/0xsequence/go-sequence/contracts/gen/ierc1271"
1111
"github.com/0xsequence/go-sequence/contracts/gen/niftyswap"
1212
"github.com/0xsequence/go-sequence/contracts/gen/tokens"
13+
walletfactory1 "github.com/0xsequence/go-sequence/contracts/gen/v1/walletfactory"
14+
walletgasestimator1 "github.com/0xsequence/go-sequence/contracts/gen/v1/walletgasestimator"
15+
walletguest1 "github.com/0xsequence/go-sequence/contracts/gen/v1/walletguest"
16+
walletmain1 "github.com/0xsequence/go-sequence/contracts/gen/v1/walletmain"
17+
walletupgradable1 "github.com/0xsequence/go-sequence/contracts/gen/v1/walletupgradable"
18+
walletutils1 "github.com/0xsequence/go-sequence/contracts/gen/v1/walletutils"
1319
walletfactory2 "github.com/0xsequence/go-sequence/contracts/gen/v2/walletfactory"
1420
walletgasestimator2 "github.com/0xsequence/go-sequence/contracts/gen/v2/walletgasestimator"
1521
walletguest2 "github.com/0xsequence/go-sequence/contracts/gen/v2/walletguest"
1622
walletmain2 "github.com/0xsequence/go-sequence/contracts/gen/v2/walletmain"
1723
walletupgradable2 "github.com/0xsequence/go-sequence/contracts/gen/v2/walletupgradable"
1824
walletutils2 "github.com/0xsequence/go-sequence/contracts/gen/v2/walletutils"
19-
"github.com/0xsequence/go-sequence/contracts/gen/walletfactory"
20-
"github.com/0xsequence/go-sequence/contracts/gen/walletgasestimator"
21-
"github.com/0xsequence/go-sequence/contracts/gen/walletguest"
22-
"github.com/0xsequence/go-sequence/contracts/gen/walletmain"
23-
"github.com/0xsequence/go-sequence/contracts/gen/walletupgradable"
24-
"github.com/0xsequence/go-sequence/contracts/gen/walletutils"
2525
)
2626

2727
var (
28-
WalletFactory,
29-
WalletMainModule,
30-
WalletMainModuleUpgradable,
31-
WalletGuestModule,
32-
WalletUtils,
33-
WalletRequireFreshSigner,
34-
WalletGasEstimator,
3528
GasEstimator,
3629
IERC1271,
3730
ERC20Mock,
@@ -48,6 +41,16 @@ var (
4841
_ ethartifact.Artifact
4942
)
5043

44+
var V1 struct {
45+
WalletFactory ethartifact.Artifact
46+
WalletMainModule ethartifact.Artifact
47+
WalletMainModuleUpgradable ethartifact.Artifact
48+
WalletGuestModule ethartifact.Artifact
49+
WalletUtils ethartifact.Artifact
50+
WalletRequireFreshSigner ethartifact.Artifact
51+
WalletGasEstimator ethartifact.Artifact
52+
}
53+
5154
var V2 struct {
5255
WalletFactory ethartifact.Artifact
5356
WalletMainModule ethartifact.Artifact
@@ -63,13 +66,13 @@ var (
6366
)
6467

6568
func init() {
66-
WalletFactory = artifact("WALLET_FACTORY", walletfactory.WalletFactoryABI, walletfactory.WalletFactoryBin)
67-
WalletMainModule = artifact("WALLET_MAIN", walletmain.WalletMainABI, walletmain.WalletMainBin)
68-
WalletMainModuleUpgradable = artifact("WALLET_UPGRADABLE", walletupgradable.WalletUpgradableABI, walletupgradable.WalletUpgradableBin)
69-
WalletGuestModule = artifact("WALLET_GUEST", walletguest.WalletGuestABI, walletguest.WalletGuestBin)
70-
WalletUtils = artifact("WALLET_UTILS", walletutils.WalletUtilsABI, walletutils.WalletUtilsBin)
71-
WalletRequireFreshSigner = artifact("WALLET_REQUIRE_FRESH_SIGNER", walletutils.WalletRequireFreshSignerABI, walletutils.WalletRequireFreshSignerBin)
72-
WalletGasEstimator = artifact("WALLET_GAS_ESTIMATOR", walletgasestimator.WalletGasEstimatorABI, walletgasestimator.WalletGasEstimatorBin, walletgasestimator.WalletGasEstimatorDeployedBin)
69+
V1.WalletFactory = artifact("WALLET_FACTORY", walletfactory1.WalletFactoryABI, walletfactory1.WalletFactoryBin)
70+
V1.WalletMainModule = artifact("WALLET_MAIN", walletmain1.WalletMainABI, walletmain1.WalletMainBin)
71+
V1.WalletMainModuleUpgradable = artifact("WALLET_UPGRADABLE", walletupgradable1.WalletUpgradableABI, walletupgradable1.WalletUpgradableBin)
72+
V1.WalletGuestModule = artifact("WALLET_GUEST", walletguest1.WalletGuestABI, walletguest1.WalletGuestBin)
73+
V1.WalletUtils = artifact("WALLET_UTILS", walletutils1.WalletUtilsABI, walletutils1.WalletUtilsBin)
74+
V1.WalletRequireFreshSigner = artifact("WALLET_REQUIRE_FRESH_SIGNER", walletutils1.WalletRequireFreshSignerABI, walletutils1.WalletRequireFreshSignerBin)
75+
V1.WalletGasEstimator = artifact("WALLET_GAS_ESTIMATOR", walletgasestimator1.WalletGasEstimatorABI, walletgasestimator1.WalletGasEstimatorBin, walletgasestimator1.WalletGasEstimatorDeployedBin)
7376

7477
V2.WalletFactory = artifact("WALLET_FACTORY", walletfactory2.WalletFactoryABI, walletfactory2.WalletFactoryBin)
7578
V2.WalletMainModule = artifact("WALLET_MAIN", walletmain2.WalletMainABI, walletmain2.WalletMainBin)
File renamed without changes.

contracts/gen/walletgasestimator/wallet_gas_estimator.gen.go renamed to contracts/gen/v1/walletgasestimator/wallet_gas_estimator.gen.go

File renamed without changes.

contracts/gen/walletguest/wallet_guest_module.gen.go renamed to contracts/gen/v1/walletguest/wallet_guest_module.gen.go

File renamed without changes.
File renamed without changes.

contracts/gen/walletupgradable/wallet_main_module_upgradable.gen.go renamed to contracts/gen/v1/walletupgradable/wallet_main_module_upgradable.gen.go

File renamed without changes.

contracts/gen/walletutils/wallet_require_fresh_signer.gen.go renamed to contracts/gen/v1/walletutils/wallet_require_fresh_signer.gen.go

File renamed without changes.
File renamed without changes.

deployer/deployer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestDeployer(t *testing.T) {
3636
testSequenceContext := testutil.V1SequenceContext()
3737

3838
// Deploy sequence wallet-contract factory and ensure it equals the expected value in testutil
39-
walletFactoryAddress, err := ud.Deploy(context.Background(), contracts.WalletFactory.ABI, contracts.WalletFactory.Bin, 0, nil, 1000000)
39+
walletFactoryAddress, err := ud.Deploy(context.Background(), contracts.V1.WalletFactory.ABI, contracts.V1.WalletFactory.Bin, 0, nil, 1000000)
4040
assert.NoError(t, err)
4141
assert.Equal(t, testSequenceContext.FactoryAddress, walletFactoryAddress)
4242
}

estimator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/0xsequence/ethkit/go-ethereum/common"
1818
"github.com/0xsequence/ethkit/go-ethereum/common/hexutil"
1919
"github.com/0xsequence/go-sequence/contracts"
20-
"github.com/0xsequence/go-sequence/contracts/gen/walletgasestimator"
20+
"github.com/0xsequence/go-sequence/contracts/gen/v1/walletgasestimator"
2121
"github.com/0xsequence/go-sequence/core"
2222
v1 "github.com/0xsequence/go-sequence/core/v1"
2323
v2 "github.com/0xsequence/go-sequence/core/v2"
@@ -73,7 +73,7 @@ var defaultEstimator = &Estimator{
7373
}
7474

7575
var gasEstimatorCode = hexutil.Encode(contracts.GasEstimator.DeployedBin)
76-
var walletGasEstimatorCode = hexutil.Encode(contracts.WalletGasEstimator.DeployedBin)
76+
var walletGasEstimatorCode = hexutil.Encode(contracts.V1.WalletGasEstimator.DeployedBin)
7777
var walletGasEstimatorCodeV2 = hexutil.Encode(contracts.V2.WalletGasEstimator.DeployedBin)
7878

7979
func NewEstimator() *Estimator {
@@ -491,7 +491,7 @@ func (e *Estimator) Estimate(ctx context.Context, provider *ethrpc.Provider, add
491491

492492
var execData []byte
493493
if _, ok := walletConfig.(*v1.WalletConfig); ok {
494-
execData, err = contracts.WalletMainModule.Encode("execute", encTxs, nonce, signature)
494+
execData, err = contracts.V1.WalletMainModule.Encode("execute", encTxs, nonce, signature)
495495
if err != nil {
496496
return 0, err
497497
}
@@ -531,7 +531,7 @@ func V1Simulate(provider *ethrpc.Provider, wallet common.Address, transactions T
531531
return nil, err
532532
}
533533

534-
callData, err := contracts.WalletGasEstimator.Encode("simulateExecute", encoded)
534+
callData, err := contracts.V1.WalletGasEstimator.Encode("simulateExecute", encoded)
535535
if err != nil {
536536
return nil, err
537537
}
@@ -570,7 +570,7 @@ func V1Simulate(provider *ethrpc.Provider, wallet common.Address, transactions T
570570
}
571571

572572
var results []SimulateResult
573-
err = contracts.WalletGasEstimator.Decode(&results, "simulateExecute", resultsData)
573+
err = contracts.V1.WalletGasEstimator.Decode(&results, "simulateExecute", resultsData)
574574
if err != nil {
575575
return nil, err
576576
}

0 commit comments

Comments
 (0)