Object ContractAddressCalculator

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • calculateAddressFromHash

         final static Felt calculateAddressFromHash(Felt classHash, List<Felt> calldata, Felt salt, Felt deployerAddress)

        Calculate address of a contract on Starknet.

        Parameters:
        classHash - hash of the contract code
        calldata - constructor calldata used for deployment
        salt - salt used to calculate address
        deployerAddress - address that deployed contract
      • calculateAddressFromHash

         final static Felt calculateAddressFromHash(Felt classHash, List<Felt> calldata, Felt salt)

        Calculate address of a contract on Starknet. Doesn't require deployerAddress.

        Parameters:
        classHash - hash of the contract code
        calldata - constructor calldata used for deployment
        salt - salt used to calculate address
      • isChecksumAddressValid

         final static Boolean isChecksumAddressValid(String address)

        Checks if provided string is in a checksum address format.

        Parameters:
        address - to check
      • calculateChecksumAddress

         final static String calculateChecksumAddress(Felt address)

        Outputs formatted checksum address.

        Follows implementation of starknet.js. EIP55 was an inspiration, but it is not compatible as it treats hex string as encoded number, instead of encoding it as ASCII string. Example checksum address - 0x02Fd23d9182193775423497fc0c472E156C57C69E4089A1967fb288A2d84e914.

        Parameters:
        address - to encode