Skip to content

Commit

Permalink
deprecate tbd issues
Browse files Browse the repository at this point in the history
  • Loading branch information
code-z2 committed Feb 22, 2024
1 parent 5acac5f commit f4fa0da
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.7

* Deprecate passing wallet address via constructor as fields will be made final
* Enable global gas settings and fee % multiplier
* Introduce userOp retry mechanism

## 0.0.6

* Sunset all goerli chains
Expand Down
22 changes: 15 additions & 7 deletions lib/src/4337/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ class SmartWallet with _PluginManager, _GasSettings implements SmartWalletBase {
SmartWallet(
{required Chain chain,
required MultiSignerInterface signer,
required BundlerProviderBase bundler})
: _chain = chain.validate() {
required BundlerProviderBase bundler,
@Deprecated("address will be made final in the future")
EthereumAddress? address})
: _chain = chain.validate(),
_walletAddress = address {
final rpc = RPCProvider(chain.ethRpcUrl!);
final fact = _AccountFactory(
address: chain.accountFactory!, chainId: chain.chainId, rpc: rpc);
Expand Down Expand Up @@ -43,15 +46,21 @@ class SmartWallet with _PluginManager, _GasSettings implements SmartWalletBase {
/// chain: Chain.ethereum,
/// signer: myMultiSigner,
/// bundler: myBundler,
/// address: myWalletAddress,
/// initCallData: Uint8List.fromList([0x01, 0x02, 0x03]),
/// );
/// ```
/// additionally initializes the associated Entrypoint contract for `tx.wait(userOpHash)` calls
factory SmartWallet.init(
{required Chain chain,
required MultiSignerInterface signer,
required BundlerProviderBase bundler}) {
final instance =
SmartWallet(chain: chain, signer: signer, bundler: bundler);
required BundlerProviderBase bundler,
@Deprecated("address will be made final in the future")
EthereumAddress? address,
@Deprecated("seperation of factory from wallet soon will be enforced")
Uint8List? initCallData}) {
final instance = SmartWallet(
chain: chain, signer: signer, bundler: bundler, address: address);

instance.plugin('bundler').initializeWithEntrypoint(Entrypoint(
address: chain.entrypoint,
Expand Down Expand Up @@ -82,8 +91,7 @@ class SmartWallet with _PluginManager, _GasSettings implements SmartWalletBase {
Future<Uint256> get nonce => _getNonce();

@override
@Deprecated(
"pass the wallet address alongside the constructor if known beforehand")
@Deprecated("wallet address will be made final in the future")
set setWalletAddress(EthereumAddress address) => _walletAddress = address;

@override
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: variance_dart
description: An Account Abstraction (4337) Development kit, for quickly building mobile web3 apps and smart wallets.
version: 0.0.6
version: 0.0.7
documentation: https://docs.variance.space
homepage: https://variance.space
repository: https://github.com/vaariance/variance-dart
Expand Down

0 comments on commit f4fa0da

Please sign in to comment.