SmartWallet constructor
SmartWallet({
- required String abi,
- required String scwAddress,
- dynamic provider,
- required EntryPointWithoutSigner entryPointContract,
- required bool isInitialized,
- required String entryPointAddress,
- required String ownerAddress,
- required int salt,
- required String bundlerURL,
- required String rpcURL,
- List<
String> ? modules, - dynamic usePaymaster,
- dynamic batch,
- PaymasterConfig? paymasterConfig,
Implementation
SmartWallet({
required this.abi,
required this.scwAddress,
provider,
required this.entryPointContract,
required this.isInitialized,
required this.entryPointAddress,
required this.ownerAddress,
required this.salt,
required this.bundlerURL,
// required this.factoryAddress,
required this.rpcURL,
List<String>? modules,
// required this.signer,
usePaymaster,
batch,
PaymasterConfig? paymasterConfig,
// required flutter_web3.Web3Provider web3provider,
}) {
if (modules != null) {
this.modules = modules;
} else {
this.modules = [];
}
this.factoryAddress = OctacoreSmartAccountFactory().contractAddress;
if (paymasterConfig != null) {
this.paymasterConfig = paymasterConfig;
}
this.usePaymaster = usePaymaster;
if (batch != null) {
this.batch = batch;
} else {
this.batch = {};
}
// this.web3Provider = web3provider;
// TODO: on alreadty initialized contract verify if the proxy has same entrypoint and owner
// check if salt provided in is_initialized false
isVerified = true;
initCode =
// "0x99f3A4b303e7D7dFF4fEF658852DdEaDdB0717d484efa6ad0000000000000000000000002de11b40602f0ec6d902dc416996909458b5f83c0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789000000000000000000000000000000000000000000000000000000000000014300000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000";
isInitialized
? "0x"
: factoryAddress +
_getInitCodeData(ownerAddress, entryPointAddress, this.salt);
print(initCode);
// this.entryPointContract = EntryPoint(signer: signer);
// this.contract = flutter_web3.Contract(scwAddress, abi, signer);
this.web3Client = Web3Client(rpcURL, http.Client());
this.deployedContract = DeployedContract(
ContractAbi.fromJson(abi, "SmartWallet"),
EthereumAddress.fromHex(scwAddress));
}