class ToBase58Check extends NativeMethod {

    @Override
    public Object execute(Object[] arguments) {
        if (arguments == null) {
            throw new NativeContractIllegalArgumentException(HASH_NOT_PRESENT);
        }
        byte[] hash = (byte[]) arguments[0];
        if (hash == null) {
            throw new NativeContractIllegalArgumentException(HASH_NOT_PRESENT);
        }
        if (hash.length != 20) {
            throw new NativeContractIllegalArgumentException(String.format(
                    HASH_INVALID,
                    ByteUtil.toHexString(hash), hash.length
            ));
        }

        int version = ((BigInteger) arguments[1]).intValueExact();
        if (version < 0 || version >= 256) {
            throw new NativeContractIllegalArgumentException(INVALID_VERSION);
        }

        return new ExtendedVersionedChecksummedBytes(version, hash).toBase58();
    }

    public  ToBase58Check(ExecutionEnvironment executionEnvironment);

}