xclud / web3dart

Ethereum library, written in Dart.
https://pub.dev/packages/web3dart
MIT License
170 stars 94 forks source link

export length_tracking_byte_sink.dart #96

Closed developerpaaji closed 1 year ago

developerpaaji commented 1 year ago

In order to deploy contract we need 'length_tracking_byte_sink.dart' to encode abi data. Currently its not exported from web3.dart

xclud commented 1 year ago

Can you share/describe the way you are deploying your contract?

developerpaaji commented 1 year ago

Here is the code ` List data = []; data.addAll(hexToBytes(contractBinCode));

AbiType abiType = parseAbiType('(address)');

final sink = LengthTrackingByteSink();

abiType.encode(
    [EthereumAddress.fromHex(marketplaceAddress)], sink);

data.addAll(sink.asBytes());

final transaction = Transaction(
  to: null,
  from: walletService.credentials!.address,
  data: Uint8List.fromList(data),
);

final transactionHash = await web3Client.sendTransaction(
    walletService.credentials!, transaction,
    chainId: 80001);

`

xclud commented 1 year ago

I will fix this issue with the next release.

Meanwhile, use this code:

import 'package:web3dart/src/utils/length_tracking_byte_sink.dart';

Closing this one but please feel free to open a new issue anytime.

developerpaaji commented 1 year ago

Yeah i am using this way if you want i can create pull request and you can accept it

xclud commented 1 year ago

Please do :)

xclud commented 1 year ago

Please make a part.

developerpaaji commented 1 year ago

oh okay

developerpaaji commented 1 year ago

created