AltMe
AltMe copied to clipboard
How to convert following michelson sentences in Micheline?
final parameters = token.isFA1
? '''(Pair "${keyStore.publicKeyHash}" (Pair "${state.withdrawalAddress}" $amount))'''
: '''{Pair "${keyStore.publicKeyHash}" {Pair "${state.withdrawalAddress}" (Pair ${int.parse(token.tokenId ?? '0')} $amount)}}''';
An hint on finding Micheline parameters with breakpoint on beacon transaction:
example (not tested yet):
import 'package:tezart/src/micheline_encoder.dart';
void main() {
final michelsonCode = """
parameter int;
storage int;
code {
CAR;
SWAP;
ADD;
NIL operation;
PAIR
}
""";
final michelineJson = MichelineEncoder.parse(michelsonCode);
print(michelineJson);
final michelineBinary = MichelineEncoder.encode(michelineJson);
print(michelineBinary.toHex());
}