Closed VictorECDSA closed 3 years ago
address
is treated similarly to uint160
, so if you have the address as a String, something like new BigInteger("f85a7c4b088c07ec9e982f158b63385ff20d6757", 16);
should work. 16 to indicate hexadecimal encoding, base 16
address
is treated similarly touint160
, so if you have the address as a String, something likenew BigInteger("f85a7c4b088c07ec9e982f158b63385ff20d6757", 16);
should work. 16 to indicate hexadecimal encoding, base 16
it is work. thank you!
Just added new utility methods:
BigInteger address = BigIntegerType.decodeAddress("0x0000000000000000000082095cafebabecafebab")
String address = BigIntegerType.formatAddress(bigInt)
There is a new datatype for addresses in v5.5.0. See Address.wrap
https://github.com/esaulpaugh/headlong/blob/master/src/main/java/com/esaulpaugh/headlong/abi/Address.java
throw exception as follow:
Exception in thread "main" java.lang.IllegalArgumentException: tuple index 0: class mismatch: java.lang.String not assignable to java.math.BigInteger (String not instanceof BigInteger/address)
please help me, thank you